Advertisement
emcek

test_ping

Oct 29th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. USER=emc
  4. HOME=/home/emc
  5. SERVER="89.16.167.134"
  6. SERVER2="89.16.167.13"
  7. SERVER1="www.gentoo.org"
  8.  
  9. PING=`/bin/ping -W1 -c1 $SERVER | grep "received" | cut -d" " -f4`
  10. if ! [[ "$PING" =~ ^[0-9]+$ ]] ; then
  11.         PING=0
  12. fi
  13.  
  14. echo $PING
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement