======================================
#!/usr/bin/perl
# if your prgram has the string "grep" in the name or in the path
# this program won't work.
$pro2check = "service name";
open PROS, "ps -ef|grep $pro2check |";
while ($line =
unless ($line =~ m/grep/){
#print "it is running\n";
exit;
}
}
#print "it isn't running\n";
exec "service $pro2check start";
========================
No comments:
Post a Comment