Advertisement
diggidre

Bash with ping and if

Dec 9th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.21 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. HOST=192.168.xxx.xxx
  4. #
  5. ping -w 86400 -i5 $HOST 0>/dev/null
  6. OFFLINE=$?
  7. #
  8. if [ $OFFLINE -eq 1 ]
  9. then
  10.   echo "Starte Warteskript"
  11.   sudo bash /pfadzuskript/skript.sh
  12. else
  13.   echo "$HOST is online"
  14. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement