versions() fixed mysql version (macOS), services() pid as integer

This commit is contained in:
Sebastian Hildebrandt
2020-02-16 17:58:27 +01:00
parent 1d1bf0a7c9
commit 3c0052becc
7 changed files with 151 additions and 8 deletions
+11 -3
View File
@@ -492,9 +492,17 @@ function versions(callback) {
exec('mysql -V', function (error, stdout) {
if (!error) {
let mysql = stdout.toString().split('\n')[0] || '';
mysql = (mysql.toLowerCase().split(',')[0] || '').trim();
const parts = mysql.split(' ');
result.mysql = (parts[parts.length - 1] || '').trim();
mysql = mysql.toLowerCase();
if (mysql.indexOf(',') > -1) {
mysql = (mysql.split(',')[0] || '').trim();
const parts = mysql.split(' ');
result.mysql = (parts[parts.length - 1] || '').trim();
} else {
if (mysql.indexOf(' ver ') > -1) {
mysql = mysql.split(' ver ')[1];
result.mysql = mysql.split(' ')[0];
}
}
}
functionProcessed();
});
+4 -1
View File
@@ -135,7 +135,10 @@ function services(srv, callback) {
let singleSrv = allSrv.filter(item => { return item.name === srv; });
const pids = [];
for (const p of ps) {
pids.push(p.trim().split(' ')[2]);
const pid = p.trim().split(' ')[2];
if (pid) {
pids.push(parseInt(pid, 10));
}
}
result.push({
name: srv,