Added waiting time conversion
This commit is contained in:
parent
5dcd8c8da5
commit
92a8cd9556
|
@ -48,7 +48,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
$("body").on("input", "input[name=url]", function() {
|
$("body").on("input", "input[name=url]", function() {
|
||||||
if($("input[name=url]").val().startsWith("reboot")) {
|
if($("input[name=url]").val().startsWith("reboot")) {
|
||||||
$("#url-description").html("This job triggers a reboot. Please use <pre>reboot cmd={{command}}&services={{command}}</pre> to modify the reboot and get services commands. You can use {}+ in the reboot command to use the Reboot wait configuration value");
|
$("#url-description").html("This job triggers a reboot. Please use <pre>reboot cmd={{command}}&services={{command}}</pre> to modify the reboot and get services commands. You can use {s}+ or {m}+ in the reboot command to use the Reboot wait configuration value ({s}+ will convert to seconds, {m}+ to minutes)");
|
||||||
$("label[for=expected]").html("Capture services after reboot? (1: yes; 0: no)");
|
$("label[for=expected]").html("Capture services after reboot? (1: yes; 0: no)");
|
||||||
$("input[name=expected]").attr("placeholder", "1");
|
$("input[name=expected]").attr("placeholder", "1");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -140,11 +140,12 @@ if(file_exists("cache/reboot.trigger")) {
|
||||||
$cmd = $rebootcommands['cmd'];
|
$cmd = $rebootcommands['cmd'];
|
||||||
|
|
||||||
if ($cmd == '') {
|
if ($cmd == '') {
|
||||||
$cmd = 'sudo shutdown -r +{}+ "A reboot has been scheduled. Please save your work."';
|
$cmd = 'sudo shutdown -r +{m}+ "A reboot has been scheduled. Please save your work."';
|
||||||
$cmd = str_replace("{}+", intdiv(get_configvalue('jobs.rebootwait'), 60), $cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = str_replace("{}+", get_configvalue('jobs.rebootwait'), $cmd);
|
$cmd = str_replace("{m}+", intdiv(get_configvalue('jobs.rebootwait'), 60), $cmd);
|
||||||
|
$cmd = str_replace("{s}+", get_configvalue('jobs.rebootwait'), $cmd);
|
||||||
|
|
||||||
$url = "ssh " . $job['host'] . " '" . $cmd . " &'";
|
$url = "ssh " . $job['host'] . " '" . $cmd . " &'";
|
||||||
exec($url);
|
exec($url);
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
|
|
Loading…
Reference in New Issue