1#!/usr/local/bin/perl
2# shutdown.cgi
3# Shutdown the system immediately..
4
5require './init-lib.pl';
6&ReadParse();
7$access{'shutdown'} || &error($text{'shutdown_ecannot'});
8&ui_print_header(undef, $text{'shutdown_title'}, "");
9
10$ttcmd = "<tt>".&html_escape($config{'shutdown_command'})."</tt>";
11if ($in{'confirm'}) {
12	print &text('shutdown_exec', $ttcmd);
13	&shutdown_system();
14	&webmin_log("shutdown");
15	}
16else {
17	print &ui_confirmation_form(
18		"shutdown.cgi",
19		&text('shutdown_rusure', $ttcmd),
20		undef,
21		[ [ "confirm", $text{'shutdown_ok'} ] ]);
22	}
23&ui_print_footer("", $text{'index_return'});
24
25