Advertisement
Guest User

Check internet connection

a guest
Jun 26th, 2010
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.24 KB | None | 0 0
  1. #! /bin/sh
  2. #
  3. DEST="ya.ru"
  4. while [ 1 ]
  5. do
  6. STTS=`ping -c 3 -s 1000 $DEST |grep received | awk -F, '{print $2}' |awk '{print $1}' `
  7. if [ $STTS -eq 3 ]; then
  8. echo '${color1}online${color}'
  9. else
  10. echo '${color3}offline${color}'
  11. fi
  12. sleep 10
  13. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement