mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Add support for native is-enabled command
https://sourceforge.net/p/webadmin/bugs/5447/#9431
This commit is contained in:
@@ -546,6 +546,17 @@ elsif ($init_mode eq "systemd") {
|
||||
# Exists .. but is it started at boot?
|
||||
return lc($1) eq 'enabled' || lc($1) eq 'static' ? 2 : 1;
|
||||
}
|
||||
else {
|
||||
my $out = &backquote_command("systemctl is-enabled ".
|
||||
quotemeta($unit)." 2>&1");
|
||||
if ($out =~ /no such file/i) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
$out =~ s/^\s+|\s+$//g;
|
||||
return $out eq 'enabled' ? 2 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($init_mode eq "init" || $init_mode eq "upstart" ||
|
||||
$init_mode eq "systemd") {
|
||||
|
||||
Reference in New Issue
Block a user