-
-
Last edited by kvonb; January 20th, 2008 at 07:52 PM.
Try something like:
Code:#!/bin/sh REMOTE_IP=www.yahoo.com MY_PROCESS=foo CHECK_DELAY=1 while true do ping -c 1 $REMOTE_IP > /dev/null if [ $? != 0 ] then PROC_STAT=`ps -w | grep $MY_PROCESS | cut -d " " -f7` if [ "${PROC_STAT}x" == "x" ] then echo $MY_PROCESS is not running else echo $MY_PROCESS is running fi fi sleep $CHECK_DELAY done
Last edited by dwhitney67; October 6th, 2007 at 08:33 AM. Reason: expanded script
-
Last edited by kvonb; January 20th, 2008 at 07:52 PM.
Bookmarks