in reply to Re: Test for daemon
in thread Test for daemon
Also below there was a post about collecting the ps output into an array, and then grep()'ing inetd from the output, which works nicely too...use strict; my($ps_cmd,$found); $ps_cmd = '/bin/ps -auwx'; open(IN,"$ps_cmd|") || die "Couldnt exec $ps_cmd\nReason: $!\n"; while ( <IN> ) { ($found++ && last) if ($_ =~ /inetd/); } print STDERR "Danger Will Robinson\n" if (!$found);
|
|---|