ngircd-ctl.pl - fixed status command

This commit is contained in:
gashapwn 2021-03-06 22:47:30 +00:00
parent bd187d6964
commit 1924d66f43

View File

@ -4,7 +4,7 @@ use warnings;
use strict;
my @MY_ARGV = @ARGV;
my $MY_ACMD = shift;
my $MY_ACMD = shift || "";
my $NGIRCD='ngircd';
my $NGIRCD_UID = 703;
@ -24,7 +24,8 @@ if ($MY_ACMD eq "stop"){
}elsif($MY_ACMD eq "start"){
$ERROR = system("$NGIRCD");
}elsif($MY_ACMD eq "status"){
$ERROR = system("rcctl check $NGIRCD");
$ERROR = system("pgrep -u $NGIRCD_UID $NGIRCD");
printf("%s(ok)\n", $NGIRCD) if ($ERROR == 0);
}elsif($MY_ACMD eq "help"){
printf("$USAGE\n");
}else{