]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/shutdown.cgi
5 # This code is distributed under the terms of the GPL
7 # (c) The SmoothWall Team
12 # enable only the following on debugging purpose
14 #use CGI::Carp 'fatalsToBrowser';
16 require '/var/ipfire/general-functions.pl';
17 require "${General::swroot}/lang.pl";
18 require "${General::swroot}/header.pl";
24 &Header
::showhttpheaders
();
26 $cgiparams{'ACTION'} = '';
27 &Header
::getcgihash
(\
%cgiparams);
29 if ($cgiparams{'ACTION'} eq $Lang::tr
{'shutdown'}) {
31 &General
::log($Lang::tr
{'shutting down ipfire'});
32 system '/usr/local/bin/ipfirereboot down';
33 } elsif ($cgiparams{'ACTION'} eq $Lang::tr
{'reboot'}) {
35 &General
::log($Lang::tr
{'rebooting ipfire'});
36 system '/usr/local/bin/ipfirereboot boot';
38 if ($death == 0 && $rebirth == 0) {
40 &Header
::openpage
($Lang::tr
{'shutdown control'}, 1, '');
42 &Header
::openbigbox
('100%', 'left');
44 print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
46 &Header
::openbox
('100%', 'left', );
50 <td width='50%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot'}' /></td>
51 <td width='50%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown'}' /></td>
61 my $refresh = "<meta http-equiv='refresh' content='5; URL=/cgi-bin/index.cgi' />";
63 $title = $Lang::tr
{'shutting down'};
64 $message = $Lang::tr
{'ipfire has now shutdown'};
66 $title = $Lang::tr
{'rebooting'};
67 $message = $Lang::tr
{'ipfire has now rebooted'};
69 &Header
::openpage
($title, 0, $refresh);
71 &Header
::openbigbox
('100%', 'center');
74 <table width='100%' bgcolor='#ffffff'>
75 <tr><td align='center'>
76 <br /><br /><img src='/images/IPFire.png' /><br /><br /><br />
80 <font size='6'>$message</font>
86 &Header
::closebigbox
();