Here's a sample script that checks for an adsl pid and does something
when the "ps auxww" command doesn't produce a line with "adsl" in it:

----------------------------------------------------------------------------

#!/bin/bash
PID=`ps auxww | grep adsl | grep -v grep | awk '{print $2}'`
if [ -z "$PID" ]; then
   echo No adsl pid found.  Run adsl-connect. 
fi

-----------------------------------------------------------------------------

If the script, as modified by you, is, say, /usr/local/bin/checkadsl, it
will run every 5 minutes with the following line in root's crontab:

*/5 * * * * /usr/local/bin/checkadsl

For more information, do "man -a crontab".

On Sat, 8 Jun 2002, Andr� Cameron wrote:

> I am no Guru on Cron, I need to check for an adsl pid every 5 minutes and if
> it does not exist I need to run adsl-connect.  Any ideas how to do this?

-- 
Steven Yellin




_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to