Script to enable or diosable at boot

This commit is contained in:
Jamie Cameron
2015-06-07 23:10:21 -07:00
parent cdc89c352a
commit f145fb02cf
2 changed files with 26 additions and 5 deletions

18
firewalld/bootup.cgi Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/local/bin/perl
# Enable or disable firewalld at boot time
use strict;
use warnings;
require './firewalld-lib.pl';
our (%in, %config);
&ReadParse();
&foreign_require("init");
if ($in{'boot'}) {
&init::enable_at_boot($config{'init_name'});
}
else {
&init::disable_at_boot($config{'init_name'});
}
&webmin_log($in{'boot'} ? "bootup" : "bootdown");
&redirect("index.cgi?zone=".&urlize($in{'zone'}));

View File

@@ -92,11 +92,14 @@ else {
# Enable at boot
&foreign_require("init");
my $atboot = &init::action_status($config{'init_name'}) == 2 ? 1 : 0;
print &ui_buttons_row("bootup.cgi", $text{'index_bootup'},
$text{'index_bootupdesc'},
undef,
&ui_yesno_radio("boot", $atboot));
my $st = &init::action_status($config{'init_name'});
if ($st) {
my $atboot = $st == 2 ? 1 : 0;
print &ui_buttons_row("bootup.cgi", $text{'index_bootup'},
$text{'index_bootupdesc'},
[ [ "zone", $zone->{'name'} ] ],
&ui_yesno_radio("boot", $atboot));
}
print &ui_buttons_end();