Fix to use API to check for command

This commit is contained in:
Ilia Ross 2025-06-12 01:52:48 +03:00
parent bae4af7490
commit 5462c3bbf8
No known key found for this signature in database
GPG Key ID: 121E166DD9C821AB

View File

@ -64,7 +64,7 @@ sub run
};
root($o->{'config'}, \&$conf_check);
my $service = ($o->{'config'} =~ /usermin/ ? 'usermin' : 'webmin');
my $systemctlcmd = `which systemctl`;
my $systemctlcmd = &has_command('systemctl');
$systemctlcmd =~ s/\s+$//;
if ($o->{'cmd'} =~ /^(start|stop|restart|reload)$/) {
my $rs = system("$o->{'config'}/$o->{'cmd'} $service");