Advertisement
diggidre

bash check if cam is reachable

Dec 10th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. #!/bin/sh
  2. # record-ping_cam1.sh
  3. ## Check 24h if Cam is alive and if error code is 1 (offline) then start record-waitfor_xxx.sh
  4. #
  5. HOST=192.168.178.xxx
  6. #
  7. ping -w 86400 -i5 $HOST 0>/dev/null
  8. OFFLINE=$?
  9. #
  10. if [ $OFFLINE -eq 1 ]
  11. then
  12.   echo "läuft"
  13. else
  14.   sudo bash /home/xxx/scripts/nocron/record-ping-waitfor_cam1.sh
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement