Hello all,
I have a quick question about monitoring processes. I have a process
(adsl-connect) which should be running if the connection is live. Most of
the time the connection is dropped by my ISP after about a week of online
time. I'd like to write a shell script that can check and see if this
process is running and if not, restart it.
Here's a shell script that I've come up with, but can't get it to work:
#!/bin/sh
foreach DAEMON ( adsl-connect )
ps -e | fgrep "$DAEMON:t" | cut -c1-8 > /dev/null
if($status > 0) then
echo "Restarting $daemon"
#code to restart daemon
endif
end
Thanks,
Kevin
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com