File: reboot.cgi

package info (click to toggle)
webmin 1.180-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 16,900 kB
  • ctags: 2,152
  • sloc: perl: 55,792; java: 1,362; sh: 980; ansic: 221; makefile: 191
file content (24 lines) | stat: -rwxr-xr-x 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/local/bin/perl
# reboot.cgi
# Reboot the system immediately..

require './init-lib.pl';
&ReadParse();
%access = &get_module_acl();
$access{'reboot'} || &error($text{'reboot_ecannot'});
&ui_print_header(undef, $text{'reboot_title'}, "");
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'} >/dev/null 2>/dev/null");
	&webmin_log("reboot");
	}
else {
	print "<font size=+1>",&text('reboot_rusure', $ttcmd),"</font>\n";
	print "<center><form action=reboot.cgi>\n";
	print "<input type=submit value=\"$text{'reboot_ok'}\" name=confirm>\n";
	print "</form></center>\n";
	}
&ui_print_footer("", $text{'index_return'});