Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Simple SHELL script for system check by ping command
- # add ip / hostname separated by white space
- HOSTS="localhost 192.168.1.2"
- # no ping request
- COUNT=1
- # perform action
- for myHost in $HOSTS
- do
- ping -c 1 $myHost > /dev/null
- if [ $? -eq 0 ]; then
- # 100% failed
- echo "Host : $myHost is down"
- else
- # 100% succes
- <place rsync rules here>
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment