versions: added apache

This commit is contained in:
Sebastian Hildebrandt
2019-01-10 21:18:08 +01:00
parent d43ec39352
commit 5ebfe2baec
3 changed files with 374 additions and 6 deletions
+9 -1
View File
@@ -295,6 +295,7 @@ function versions(callback) {
mysql: '',
redis: '',
mongodb: '',
apache: '',
nginx: '',
php: '',
docker: '',
@@ -306,7 +307,7 @@ function versions(callback) {
};
let functionProcessed = (function () {
let totalFunctions = 19;
let totalFunctions = 20;
return function () {
if (--totalFunctions === 0) {
if (callback) {
@@ -396,6 +397,13 @@ function versions(callback) {
functionProcessed();
});
}
exec('apachectl -v 2>&1', function (error, stdout) {
if (!error) {
const apache = (stdout.toString().split('\n')[0] || '').split(':');
result.apache = (apache.length > 1 ? apache[1].replace('Apache', '').replace('/', '').trim() : '');
}
functionProcessed();
});
exec('nginx -v 2>&1', function (error, stdout) {
if (!error) {
const nginx = stdout.toString().split('\n')[0] || '';