[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[K12OSN] bash script help
- From: "Doug Simpson" <simpsond leopards k12 ar us>
- To: <k12osn redhat com>
- Subject: [K12OSN] bash script help
- Date: Tue, 30 Oct 2007 12:09:56 -0600
Hi all!
I have a script that I am trying to get to work and I can't get it right. It is a script that will write the names of offline servers to a textfile.
As it is, it only does the first server and repeats, *unless* the first server is not online, in which it writes to the file and then goes on to the next one.
How can I make it continue through the script regardless of whether or not each server is online, but still echo the text to the file if it finds one offline and then restart at the top of the list again?
The script follows.
******************************************
#!/bin/bash
while (true)
do
#sleep 30
if ping -i 3 -c 3 10.40.12.56
then
continue
else
echo "Doug's workstation is offline. Please check it!" >>serverdown.txt
fi
if ping -i 3 -c 3 10.40.12.1
then
continue
else
echo "Please check on Leopards Server. It appears to be offline!" >>serverdown.txt
fi
if ping -i 3 -c 3 10.40.12.26
then
continue
else
echo "Please check on Students server. It appears to be offline!" >>serverdown.txt
fi
if ping -i 3 -c 3 10.40.12.2
then
continue
else
echo "Please check on elementary lab server. It appears to be offline!" >>serverdown.txt
fi
if ping -i 3 -c 3 10.40.12.10
then
continue
else
echo "Please check on elementary primary server. It appears to be offline!" >>serverdown.txt
fi
done
***************************************************
Thanks for any assistance.
Doug
Doug Simpson
Technology Specialist
De Queen Public Schools
De Queen, AR
simpsond leopards k12 ar us
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]