mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2025-12-06 18:33:20 +00:00
Added checking ppp is default route to service scripts
This commit is contained in:
@@ -50,6 +50,11 @@ if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powere
|
||||
if check_network -eq 0; then
|
||||
debug "PPP chatscript is starting...";
|
||||
sudo pon;
|
||||
|
||||
# check default interface
|
||||
route | grep ppp | grep default > /dev/null
|
||||
PPP_IS_DEFAULT=$?
|
||||
if [[ $PPP_IS_DEFAULT -ne 0 ]]; then sudo route add default ppp0; debug "ppp0 is added as default interface manually." fi
|
||||
else
|
||||
debug "Network registeration is failed!";
|
||||
fi
|
||||
@@ -74,6 +79,11 @@ while true; do
|
||||
debug "Connection is down, reconnecting..."
|
||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||
sudo pon
|
||||
|
||||
# check default interface
|
||||
route | grep ppp | grep default > /dev/null
|
||||
PPP_IS_DEFAULT=$?
|
||||
if [[ $PPP_IS_DEFAULT -ne 0 ]]; then sudo route add default ppp0; debug "ppp0 is added as default interface manually." fi
|
||||
fi
|
||||
fi
|
||||
sleep $INTERVAL
|
||||
|
||||
Reference in New Issue
Block a user