1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-07 19:13:20 +00:00

freebsd update

This commit is contained in:
Bryan Roe
2019-06-21 17:35:57 -07:00
parent acc191212e
commit 83fdcbc4b9

View File

@@ -729,17 +729,16 @@ function serviceManager()
ret.appLocation = function appLocation()
{
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdin.write("cat " + this.rc + " grep command= | awk -F= '{ print $2 }' | awk -F\\\" '{ print $2 }'\\nexit\\n");
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdin.write("cat " + this.rc + " | grep command= | awk -F= '{ print $2 }' | awk -F\\\" '{ print $2 }'\nexit\n");
child.waitExit();
return (child.stdout.str.trim().replace('{name}', this.name));
return (child.stdout.str.trim().split('${name}').join(this.name));
};
ret.isRunning = function isRunning()
{
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdin.write("service " + this.name + " onestatus | awk '{ print $3 }'\\nexit\\n");
child.stdin.write("service " + this.name + " onestatus | awk '{ print $3 }'\nexit\n");
child.waitExit();
return (child.stdout.str.trim() == 'running');
};
@@ -747,7 +746,7 @@ function serviceManager()
{
var child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = ''; child.stdout.on('data', function (c) { this.str += c.toString(); });
child.stdin.write("service " + this.name + " onestatus | awk '{ split($6, res, \".\"); print res[1]; }'\\nexit\\n");
child.stdin.write("service " + this.name + " onestatus | awk '{ split($6, res, \".\"); print res[1]; }'\nexit\n");
child.waitExit();
return (parseInt(child.stdout.str.trim()) == process.pid);
};
@@ -1584,4 +1583,4 @@ module.exports.manager = new serviceManager();
if (process.platform == 'darwin')
{
module.exports.getOSVersion = getOSVersion;
}
}