#!/usr/bin/perl # # SmoothWall CGIs # # This code is distributed under the terms of the GPL # # (c) The SmoothWall Team # use strict; # enable only the following on debugging purpose #use warnings; #use CGI::Carp 'fatalsToBrowser'; require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; my %cgiparams=(); my $death = 0; my $rebirth = 0; &Header::showhttpheaders(); $cgiparams{'ACTION'} = ''; &Header::getcgihash(\%cgiparams); if ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown'}) { $death = 1; &General::log($Lang::tr{'shutting down ipfire'}); system '/usr/local/bin/ipfirereboot down'; } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'reboot'}) { $rebirth = 1; &General::log($Lang::tr{'rebooting ipfire'}); system '/usr/local/bin/ipfirereboot boot'; } if ($death == 0 && $rebirth == 0) { &Header::openpage($Lang::tr{'shutdown control'}, 1, ''); &Header::openbigbox('100%', 'left'); print "