1 #!/usr/bin/perl 2 3 my $program = "/meinskript.pl"; 4 my $foundit = 0; 5 6 open (IN, "ps axw |"); 7 while () { 8 if (/$program/) { 9 $foundit = 1; 10 last; 11 } 12 } 13 close IN; 14 15 print "Content-Type: text/html\n\n"; 16 if (!$foundit) 17 { 18 print "starte $program
"; 19 system("deamon.pl") or print "problem! $!"; 20 } 21 else 22 { 23 print "$program läuft bereits
"; 24 } 25 print "Fertig"; 26 exit;