mirror of
https://github.com/webmin/webmin.git
synced 2026-05-04 22:30:33 +01:00
Script to enable or diosable at boot
This commit is contained in:
18
firewalld/bootup.cgi
Executable file
18
firewalld/bootup.cgi
Executable 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'}));
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user