Advertisement
diggidre

while ping

Dec 12th, 2018
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.40 KB | None | 0 0
  1. #!/bin/sh
  2. # record-ping-waitfor_cam1.sh
  3. # Check if Cam is alive or reachable, if yes (ping exit code 0) then execute record-ping-reconnect_xxx.sh
  4. #
  5. # Ping in an infintive loop - as soon as reachable (exit code 0) then go on with record script
  6. IPCAM=192.168.178.xxx
  7. #
  8. while true; do ping -c1 $IPCAM > /dev/null && break; done
  9. ONLINE=$?
  10. #
  11. if [ $ONLINE -eq 0 ]
  12. then
  13.   source /home/xxx/record-ping-reconnect_cam1.sh
  14. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement