Guest User

Untitled

a guest
Aug 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. HNAME=news-15.net # Notorious spammer.
  2. # HNAME=$HOST
  3. # Debug: test for localhost.
  4. count=2 # Send only two pings.
  5. if [[ `ping -c $count "$HNAME"` ]]
  6. then
  7. echo ""$HNAME" still up and broadcasting spam your way."
  8. else
  9. echo ""$HNAME" seems to be down. Pity."
  10. fi
  11.  
  12. HNAME=192.168.1.21
  13. count=2 # Send only two pings.
  14. if ping -c $count "$HNAME" 2> /dev/null
  15. then
  16. echo ""$HNAME" still up and broadcasting spam your way."
  17. else
  18. echo ""$HNAME" seems to be down. Pity."
  19. fi
Add Comment
Please, Sign In to add comment