in reply to Why won't it die??
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Why won't it die??
by Anonymous Monk on Aug 22, 2002 at 03:12 UTC | |
by Aristotle (Chancellor) on Aug 22, 2002 at 03:32 UTC |