mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2024-12-23 17:57:36 +00:00
BASE HAT reconnect script added
This commit is contained in:
parent
147c65f776
commit
3f7782e949
21
ppp_installer/reconnect_basehat
Normal file
21
ppp_installer/reconnect_basehat
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# /usr/src/reconnect
|
||||
# for Base HAT
|
||||
|
||||
gpio -g mode 26 out #HAT_POWER_OFF
|
||||
gpio -g mode 19 out #W_DISABLE
|
||||
|
||||
gpio -g write 26 0
|
||||
gpio -g write 19 0
|
||||
|
||||
while true; do
|
||||
|
||||
ping -q -I ppp0 -c 1 8.8.8.8 -s 0 >/dev/null
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Connection down, reconnecting..."
|
||||
sudo pon
|
||||
fi
|
||||
|
||||
sleep 10
|
||||
done
|
Loading…
Reference in New Issue
Block a user