Guest User

Untitled

a guest
Aug 13th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #!/bin/bash
  2. # Simple SHELL script for system check by ping command
  3.  
  4. # add ip / hostname separated by white space
  5. HOSTS="localhost 192.168.1.2"
  6.  
  7. # no ping request
  8. COUNT=1
  9.  
  10. # perform action
  11. for myHost in $HOSTS
  12. do
  13. ping -c 1 $myHost > /dev/null
  14. if [ $? -eq 0 ]; then
  15. # 100% failed
  16. echo "Host : $myHost is down"
  17. else
  18. # 100% succes
  19. <place rsync rules here>
  20. fi
  21. done
Advertisement
Add Comment
Please, Sign In to add comment