Merge branch 'task/reboot-convert-wait'
This commit is contained in:
commit
6104aadbf5
|
@ -48,7 +48,7 @@ $(document).ready(function() {
|
|||
});
|
||||
$("body").on("input", "input[name=url]", function() {
|
||||
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)");
|
||||
$("input[name=expected]").attr("placeholder", "1");
|
||||
} else {
|
||||
|
|
|
@ -140,11 +140,12 @@ if(file_exists("cache/reboot.trigger")) {
|
|||
$cmd = $rebootcommands['cmd'];
|
||||
|
||||
if ($cmd == '') {
|
||||
$cmd = 'sudo shutdown -r +{}+ "A reboot has been scheduled. Please save your work."';
|
||||
$cmd = str_replace("{}+", intdiv(get_configvalue('jobs.rebootwait'), 60), $cmd);
|
||||
$cmd = 'sudo shutdown -r +{m}+ "A reboot has been scheduled. Please save your work."';
|
||||
}
|
||||
|
||||
$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 . " &'";
|
||||
exec($url);
|
||||
$cmd = '';
|
||||
|
|
Loading…
Reference in New Issue