A Simple Script
Hi,
I am trying to write a simple script, that we be activated by CRON every hour, to check whether WGET is working or not.
If its not working - it should activate it.
What I have so far:
#!/bin/bash
ps ax > tempdata
grep -q wget tempdata
if [ $? -eq "0" ]
then
echo "Already Working"
else
wget -m .......
fi
rm -f tempdata
Anyone has a suggestion how to write this script, without creating a file? (TEMPDATA)
Simply writing "ps ax | grep wget" is not good, cuz grep will always find the process "grep wget"....
Thanks in Advance,
|