Add absolute paths for binaries for cron starts lacking PATH exports to address https://github.com/Akkadius/glass-isc-dhcp/issues/2
This commit is contained in:
parent
0ea0367178
commit
7ac8c91cd1
|
@ -15,7 +15,7 @@ router.post('/', authorize.auth, function(req, res, next) {
|
|||
|
||||
var exec = require('child_process').exec;
|
||||
|
||||
exec('dhcpd -t -cf ./syntax_verify_config > verify_output 2> verify_output', function(err, stdout, stderr)
|
||||
exec('/usr/sbin/dhcpd -t -cf ./syntax_verify_config > verify_output 2> verify_output', function(err, stdout, stderr)
|
||||
{
|
||||
var output = fs.readFileSync('./verify_output', "utf8");
|
||||
|
||||
|
@ -46,7 +46,7 @@ router.post('/', authorize.auth, function(req, res, next) {
|
|||
}
|
||||
|
||||
//date +"%Y-%m-%d_%H:%M:%S"
|
||||
exec('cp ' + glass_config.config_file + ' ./config_backups/`basename ' + glass_config.config_file + '`_`date +"%Y-%m-%d_%H:%M:%S"`',
|
||||
exec('/bin/cp ' + glass_config.config_file + ' ./config_backups/`basename ' + glass_config.config_file + '`_`date +"%Y-%m-%d_%H:%M:%S"`',
|
||||
function(err, stdout, stderr) {
|
||||
|
||||
});
|
||||
|
|
|
@ -53,11 +53,11 @@ router.post('/', authorize.auth, function(req, res, next) {
|
|||
res.send("<script type='text/javascript'>notification('DHCP Server Stopped');ignore_cache = 1;do_pjax_request('/dhcp_start_stop_restart');$('#mdModal').modal('hide');</script>");
|
||||
break;
|
||||
case "start":
|
||||
dhcp_exec = execSync('service isc-dhcp-server start');
|
||||
dhcp_exec = execSync('/usr/sbin/service isc-dhcp-server start');
|
||||
res.send("<script type='text/javascript'>notification('DHCP Server Started');ignore_cache = 1;do_pjax_request('/dhcp_start_stop_restart');</script>");
|
||||
break;
|
||||
case "restart":
|
||||
dhcp_exec = execSync('service isc-dhcp-server restart && sleep 1');
|
||||
dhcp_exec = execSync('/usr/sbin/service isc-dhcp-server restart && sleep 1');
|
||||
res.send("<script type='text/javascript'>notification('DHCP Server Restarted " + dhcp_exec + "');ignore_cache = 1;do_pjax_request('/dhcp_start_stop_restart');$('#mdModal').modal('hide');</script>");
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue