From 1924d66f43417051d340138d145b745043e0f809 Mon Sep 17 00:00:00 2001 From: gashapwn Date: Sat, 6 Mar 2021 22:47:30 +0000 Subject: [PATCH] ngircd-ctl.pl - fixed status command --- perl-script/ngircd-ctl.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perl-script/ngircd-ctl.pl b/perl-script/ngircd-ctl.pl index e1b0066..22e6908 100644 --- a/perl-script/ngircd-ctl.pl +++ b/perl-script/ngircd-ctl.pl @@ -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{