mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Moved reboot and shutdown command calls to functions
This commit is contained in:
@@ -1116,5 +1116,15 @@ foreach my $f (split(/\s+/, $config{'rc_conf'})) {
|
||||
}
|
||||
}
|
||||
|
||||
sub reboot_system
|
||||
{
|
||||
&system_logged("$config{'reboot_command'} >$null_file 2>$null_file");
|
||||
}
|
||||
|
||||
sub shutdown_system
|
||||
{
|
||||
&system_logged("$config{'shutdown_command'} >$null_file 2>$null_file");
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ print "<p>\n";
|
||||
$ttcmd = "<tt>$config{'reboot_command'}</tt>";
|
||||
if ($in{'confirm'}) {
|
||||
print "<font size=+1>",&text('reboot_exec', $ttcmd),"</font><p>\n";
|
||||
&system_logged("$config{'reboot_command'} >$null_file 2>$null_file");
|
||||
&reboot_system();
|
||||
&webmin_log("reboot");
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -11,7 +11,7 @@ print "<p>\n";
|
||||
$ttcmd = "<tt>$config{'shutdown_command'}</tt>";
|
||||
if ($in{'confirm'}) {
|
||||
print "<font size=+1>",&text('shutdown_exec', $ttcmd),"</font><p>\n";
|
||||
&system_logged("$config{'shutdown_command'} >$null_file 2>$null_file");
|
||||
&shutdown_system();
|
||||
&webmin_log("shutdown");
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user