mirror of
https://github.com/webmin/webmin.git
synced 2025-07-25 15:09:18 +00:00
Factor out check for atd init script
This commit is contained in:
13
at/at-lib.pl
13
at/at-lib.pl
@ -153,5 +153,18 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# get_init_status()
|
||||||
|
# If the init module is installed and there is an atd bootup action, return
|
||||||
|
# its name, current running status and boot status
|
||||||
|
sub get_init_status
|
||||||
|
{
|
||||||
|
return () if (!&foreign_available("init"));
|
||||||
|
my $init = defined(&get_init_name) ? &get_init_name() : undef;
|
||||||
|
return () if (!$init);
|
||||||
|
my $r = &init::status_action($init);
|
||||||
|
my $atboot = &init::action_status($init);
|
||||||
|
return ($init, $r, $atboot);
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
@ -138,10 +138,8 @@ if ($access{'allow'} && $config{'allow_file'}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# If there is an init script that runs an atd server, show status
|
# If there is an init script that runs an atd server, show status
|
||||||
if (&foreign_available("init")) {
|
my ($init, $r, $atboot) = &get_init_status();
|
||||||
&foreign_require("init");
|
if ($access{'stop'} && $init) {
|
||||||
my $init = defined(&get_init_name) ? &get_init_name() : undef;
|
|
||||||
if ($access{'stop'} && $init) {
|
|
||||||
print &ui_hr();
|
print &ui_hr();
|
||||||
print &ui_buttons_start();
|
print &ui_buttons_start();
|
||||||
|
|
||||||
@ -166,7 +164,6 @@ if (&foreign_available("init")) {
|
|||||||
|
|
||||||
print &ui_buttons_end();
|
print &ui_buttons_end();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
&ui_print_footer("/", $text{'index'});
|
&ui_print_footer("/", $text{'index'});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user