Skip to content

Commit

Permalink
added network_lost_reboot_trigger.sh for rebooting RPi when offline
Browse files Browse the repository at this point in the history
  • Loading branch information
larsfroelich committed Jan 24, 2025
1 parent ec4fb13 commit d9d5bf1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions software/gateway/scripts/network_lost_reboot_trigger.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

ping -c 1 8.8.8.8

RETURN=$?

if [ $RETURN -eq 0 ];
then
echo "Network connected. No need to reboot"
exit 0
else
echo "Network connection lost! Rebooting..."
reboot
fi

0 comments on commit d9d5bf1

Please sign in to comment.