diff --git a/firewalld/bootup.cgi b/firewalld/bootup.cgi new file mode 100755 index 000000000..81d02ed01 --- /dev/null +++ b/firewalld/bootup.cgi @@ -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'})); + diff --git a/firewalld/index.cgi b/firewalld/index.cgi index 46a8d282f..1ffbba265 100644 --- a/firewalld/index.cgi +++ b/firewalld/index.cgi @@ -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();