Update: added checks for system success.#!/usr/bin/perl -wT use strict; $ENV{PATH} = '/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin'; my @process = `ps -u me`; # only call ps(1) once if (grep /ircd/, @process) { # use Perl's builtin grep print "Ircd is up!\n"; } else { print "Starting Ircd......\n"; # use system(LIST) rather than backticks system qw(sudo -u dsirc /home/me/Unreal3.1.4/src/ircd) or die "Failed to launch ircd!\n"; } if (grep /wrecked/, @process) { print "Services are up!\n"; } else { print "Starting Services......\n"; system qw(sudo -u dsirc /home/me/services/wrecked) or die "Failed to launch services!\n"; }
Makeshifts last the longest.
In reply to Re: Why won't it die??
by Aristotle
in thread Why won't it die??
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |