mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2024-11-22 02:54:53 +00:00
Added checking ppp is default route to service scripts
This commit is contained in:
parent
e0c6edf847
commit
0f93aaa4a1
@ -18,6 +18,11 @@ gpio -g write $W_DISABLE 0
|
|||||||
if check_network -eq 0; then
|
if check_network -eq 0; then
|
||||||
debug "PPP chatscript is starting...";
|
debug "PPP chatscript is starting...";
|
||||||
sudo pon;
|
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
|
else
|
||||||
debug "Network registeration is failed!";
|
debug "Network registeration is failed!";
|
||||||
fi
|
fi
|
||||||
@ -42,6 +47,11 @@ while true; do
|
|||||||
debug "Connection is down, reconnecting..."
|
debug "Connection is down, reconnecting..."
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||||
sudo pon
|
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
|
||||||
fi
|
fi
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
|
@ -6,6 +6,11 @@ source configs.sh
|
|||||||
if check_network -eq 0; then
|
if check_network -eq 0; then
|
||||||
debug "PPP chatscript is starting...";
|
debug "PPP chatscript is starting...";
|
||||||
sudo pon;
|
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
|
else
|
||||||
debug "Network registeration is failed!";
|
debug "Network registeration is failed!";
|
||||||
fi
|
fi
|
||||||
@ -30,6 +35,11 @@ while true; do
|
|||||||
debug "Connection is down, reconnecting..."
|
debug "Connection is down, reconnecting..."
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||||
sudo pon
|
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
|
||||||
fi
|
fi
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
|
@ -59,6 +59,12 @@ if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powere
|
|||||||
if check_network -eq 0; then
|
if check_network -eq 0; then
|
||||||
debug "PPP chatscript is starting...";
|
debug "PPP chatscript is starting...";
|
||||||
sudo pon;
|
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
|
else
|
||||||
debug "Network registeration is failed!";
|
debug "Network registeration is failed!";
|
||||||
fi
|
fi
|
||||||
@ -83,6 +89,11 @@ while true; do
|
|||||||
debug "Connection is down, reconnecting..."
|
debug "Connection is down, reconnecting..."
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||||
sudo pon
|
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
|
||||||
fi
|
fi
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
|
@ -60,6 +60,11 @@ if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powere
|
|||||||
if check_network -eq 0; then
|
if check_network -eq 0; then
|
||||||
debug "PPP chatscript is starting...";
|
debug "PPP chatscript is starting...";
|
||||||
sudo pon;
|
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
|
else
|
||||||
debug "Network registeration is failed!";
|
debug "Network registeration is failed!";
|
||||||
fi
|
fi
|
||||||
@ -84,6 +89,11 @@ while true; do
|
|||||||
debug "Connection is down, reconnecting..."
|
debug "Connection is down, reconnecting..."
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||||
sudo pon
|
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
|
||||||
fi
|
fi
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
|
@ -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
|
if check_network -eq 0; then
|
||||||
debug "PPP chatscript is starting...";
|
debug "PPP chatscript is starting...";
|
||||||
sudo pon;
|
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
|
else
|
||||||
debug "Network registeration is failed!";
|
debug "Network registeration is failed!";
|
||||||
fi
|
fi
|
||||||
@ -74,6 +79,11 @@ while true; do
|
|||||||
debug "Connection is down, reconnecting..."
|
debug "Connection is down, reconnecting..."
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||||
sudo pon
|
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
|
||||||
fi
|
fi
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
source functions.sh
|
|
||||||
source configs.sh
|
|
||||||
|
|
||||||
|
|
||||||
if check_network -eq 0; then
|
|
||||||
debug "PPP chatscript is starting...";
|
|
||||||
sudo pon;
|
|
||||||
else
|
|
||||||
debug "Network registeration is failed!";
|
|
||||||
fi
|
|
||||||
|
|
||||||
while true; do
|
|
||||||
# Checking cellular internet connection
|
|
||||||
ping -q -c 1 -s 0 -w $PING_TIMEOUT -I ppp0 8.8.8.8 > /dev/null 2>&1
|
|
||||||
PINGG=$?
|
|
||||||
|
|
||||||
if [[ $PINGG -eq 0 ]]; then
|
|
||||||
printf "."
|
|
||||||
else
|
|
||||||
printf "/"
|
|
||||||
sleep $DOUBLE_CHECK_WAIT
|
|
||||||
# Checking cellular internet connection
|
|
||||||
ping -q -c 1 -s 0 -w $PING_TIMEOUT -I ppp0 8.8.8.8 > /dev/null 2>&1
|
|
||||||
PINGG=$?
|
|
||||||
|
|
||||||
if [[ $PINGG -eq 0 ]]; then
|
|
||||||
printf "+"
|
|
||||||
else
|
|
||||||
debug "Connection is down, reconnecting..."
|
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
|
||||||
sudo pon
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
sleep $INTERVAL
|
|
||||||
done
|
|
@ -60,6 +60,11 @@ if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powere
|
|||||||
if check_network -eq 0; then
|
if check_network -eq 0; then
|
||||||
debug "PPP chatscript is starting...";
|
debug "PPP chatscript is starting...";
|
||||||
sudo pon;
|
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
|
else
|
||||||
debug "Network registeration is failed!";
|
debug "Network registeration is failed!";
|
||||||
fi
|
fi
|
||||||
@ -84,6 +89,11 @@ while true; do
|
|||||||
debug "Connection is down, reconnecting..."
|
debug "Connection is down, reconnecting..."
|
||||||
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
if check_network -eq 0; then sleep 0.1; else debug "Network registeration is failed!"; fi
|
||||||
sudo pon
|
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
|
||||||
fi
|
fi
|
||||||
sleep $INTERVAL
|
sleep $INTERVAL
|
||||||
|
Loading…
Reference in New Issue
Block a user