Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HNAME=news-15.net # Notorious spammer.
- # HNAME=$HOST
- # Debug: test for localhost.
- count=2 # Send only two pings.
- if [[ `ping -c $count "$HNAME"` ]]
- then
- echo ""$HNAME" still up and broadcasting spam your way."
- else
- echo ""$HNAME" seems to be down. Pity."
- fi
- HNAME=192.168.1.21
- count=2 # Send only two pings.
- if ping -c $count "$HNAME" 2> /dev/null
- then
- echo ""$HNAME" still up and broadcasting spam your way."
- else
- echo ""$HNAME" seems to be down. Pity."
- fi
Add Comment
Please, Sign In to add comment