Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ###
- # 2/3/09
- # adv-shutdown.sh
- # Advanced Shutdown Script
- # Ref - http://basskozz.wordpress.com/2009/02/03/advanced-shutdown-script-powersaving/
- ###
- IP_LIST='192.168.1.101 192.168.1.102 192.168.1.103 192.168.1.104'
- ALIVE=0
- for IP in $IP_LIST; do
- ping -q -c1 -w5 $IP
- if [ $? -eq 0 ]; then
- ALIVE=1
- echo "$IP is alive: $(date)" >> /home/user/scripts/adv-shutdown.log
- break
- fi
- done
- if [ $ALIVE -eq 0 ]; then
- echo "***ShutDown*** $(date)" >> /home/user/scripts/adv-shutdown.log
- echo "###########################" >> /home/user/scripts/adv-shutdown.log
- /sbin/shutdown -h now
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement