summaryrefslogtreecommitdiffstats
path: root/raspi/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'raspi/usr/local')
-rw-r--r--raspi/usr/local/bin/wifi-restart-on-no-ping.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/raspi/usr/local/bin/wifi-restart-on-no-ping.sh b/raspi/usr/local/bin/wifi-restart-on-no-ping.sh
new file mode 100644
index 0000000..b8190a1
--- /dev/null
+++ b/raspi/usr/local/bin/wifi-restart-on-no-ping.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+while true; do
+ ping -c 1 1.1.1.1
+ if [ "$?" -ne 0 ]; then
+ systemctl restart wpa_supplicant@wlan1.service
+ ifconfig wlan1 10.0.0.98 netmask 255.255.255.0
+ route add -net 10.0.0.0 netmask 255.255.255.0 dev wlan1
+ route add default gw 10.0.0.1 dev wlan1
+ route del default gw 0.0.0.0 dev eth0
+ fi
+sleep 1800
+done \ No newline at end of file