diff --git a/ppp_install.sh b/ppp_install.sh index c9a2054..714f5db 100755 --- a/ppp_install.sh +++ b/ppp_install.sh @@ -205,10 +205,6 @@ sed -i "s/#APN/$carrierapn/" provider sed -i "s/#DEVICE/$devicename/" provider mv provider /etc/ppp/peers/provider -if ! (grep -q 'sudo route' /etc/ppp/ip-up ); then - echo "sudo route add default ppp0" >> /etc/ppp/ip-up -fi - if [[ $shield_hat -eq 2 ]] || [[ $shield_hat -eq 6 ]]; then if ! (grep -q 'max_usb_current' /boot/config.txt ); then echo "max_usb_current=1" >> /boot/config.txt diff --git a/ppp_install_jetson.sh b/ppp_install_jetson.sh index 9db430c..54301aa 100755 --- a/ppp_install_jetson.sh +++ b/ppp_install_jetson.sh @@ -132,9 +132,5 @@ sed -i "s/#APN/$carrierapn/" provider sed -i "s/#DEVICE/$devicename/" provider mv provider /etc/ppp/peers/provider -if ! (grep -q 'sudo route' /etc/ppp/ip-up ); then - echo "sudo route add default ppp0" >> /etc/ppp/ip-up -fi - read -p "Press ENTER key to reboot" ENTER reboot \ No newline at end of file diff --git a/ppp_install_standalone.sh b/ppp_install_standalone.sh index fc25a5d..402e6cf 100755 --- a/ppp_install_standalone.sh +++ b/ppp_install_standalone.sh @@ -210,10 +210,6 @@ sed -i "s/#APN/$carrierapn/" provider sed -i "s/#DEVICE/$devicename/" provider mv provider /etc/ppp/peers/provider -if ! (grep -q 'sudo route' /etc/ppp/ip-up ); then - echo "sudo route add default ppp0" >> /etc/ppp/ip-up -fi - if [[ $shield_hat -eq 2 ]] || [[ $shield_hat -eq 6 ]]; then if ! (grep -q 'max_usb_current' /boot/config.txt ); then echo "max_usb_current=1" >> /boot/config.txt diff --git a/src/configure_modem.sh b/src/configure_modem.sh index 3d3b251..e7f6f15 100644 --- a/src/configure_modem.sh +++ b/src/configure_modem.sh @@ -177,5 +177,5 @@ fi # Check the network is ready # -------------------------- -if check_network -eq 0; then exit 0; else debug "Network registeration is failed!. Modem configuration is unsuccesfully ended!"; exit 1; fi +if check_network -eq 0; then exit 0; else debug "Network registration is failed!. Modem configuration is unsuccesfully ended!"; exit 1; fi diff --git a/src/functions.sh b/src/functions.sh index 035f191..4e7d1e9 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -31,7 +31,7 @@ function check_network() if [[ $SIM_READY -ne 0 ]]; then atcom AT+CPIN? | grep "CPIN:"; fi - debug "Network Registeration Status: " "-n" # no line break + debug "Network Registration Status: " "-n" # no line break NR_TEXT=`atcom AT+CREG? | grep "CREG:"` echo $NR_TEXT @@ -41,7 +41,7 @@ function check_network() # For native SIM echo $NR_TEXT | grep "CREG: 0,1" > /dev/null NETWORK_REG_2=$? - # Combined network registeration status + # Combined network registration status NETWORK_REG=$((NETWORK_REG+NETWORK_REG_2)) if [[ $SIM_READY -eq 0 ]] && [[ $NETWORK_REG -le 1 ]]; then @@ -50,10 +50,10 @@ function check_network() return 0 break else - debug "Retrying network registeration..." + debug "Retrying network registration..." fi sleep 2 done - debug "Network registeration is failed! Please check SIM card, data plan, antennas etc." + debug "Network registration is failed! Please check SIM card, data plan, antennas etc." return 1 } diff --git a/src/provider b/src/provider index fe32465..2a427a8 100644 --- a/src/provider +++ b/src/provider @@ -13,6 +13,7 @@ persist debug # If you want to use the HSDPA link as your gateway defaultroute +replacedefaultroute # pppd must not propose any IP address to the peer noipdefault # No ppp compression diff --git a/src/reconnect_scripts/reconnect_basehat b/src/reconnect_scripts/reconnect_basehat index 6593766..5ac685e 100644 --- a/src/reconnect_scripts/reconnect_basehat +++ b/src/reconnect_scripts/reconnect_basehat @@ -24,7 +24,7 @@ if check_network -eq 0; then 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!"; + debug "Network registration is failed!"; fi while true; do @@ -45,7 +45,7 @@ while true; do printf "+" else 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 registration is failed!"; fi sudo pon # check default interface diff --git a/src/reconnect_scripts/reconnect_baseshield b/src/reconnect_scripts/reconnect_baseshield index 00f80c7..c7ea026 100755 --- a/src/reconnect_scripts/reconnect_baseshield +++ b/src/reconnect_scripts/reconnect_baseshield @@ -12,7 +12,7 @@ if check_network -eq 0; then 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!"; + debug "Network registration is failed!"; fi while true; do @@ -33,7 +33,7 @@ while true; do printf "+" else 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 registration is failed!"; fi sudo pon # check default interface diff --git a/src/reconnect_scripts/reconnect_cellulariot b/src/reconnect_scripts/reconnect_cellulariot index be9d093..d06070c 100644 --- a/src/reconnect_scripts/reconnect_cellulariot +++ b/src/reconnect_scripts/reconnect_cellulariot @@ -66,7 +66,7 @@ if check_network -eq 0; then 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!"; + debug "Network registration is failed!"; fi while true; do @@ -89,7 +89,7 @@ while true; do debug "Connection is down, reconnecting..." restart_power if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powered up! Check the hardware setup!"; fi - 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 registration is failed!"; fi sudo pon # check default interface diff --git a/src/reconnect_scripts/reconnect_cellulariot_app b/src/reconnect_scripts/reconnect_cellulariot_app index b1053f1..79c68fc 100644 --- a/src/reconnect_scripts/reconnect_cellulariot_app +++ b/src/reconnect_scripts/reconnect_cellulariot_app @@ -66,7 +66,7 @@ if check_network -eq 0; then 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!"; + debug "Network registration is failed!"; fi while true; do @@ -89,7 +89,7 @@ while true; do debug "Connection is down, reconnecting..." restart_power if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powered up! Check the hardware setup!"; fi - 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 registration is failed!"; fi sudo pon # check default interface diff --git a/src/reconnect_scripts/reconnect_gprsshield b/src/reconnect_scripts/reconnect_gprsshield index a630ff2..9042901 100644 --- a/src/reconnect_scripts/reconnect_gprsshield +++ b/src/reconnect_scripts/reconnect_gprsshield @@ -55,7 +55,7 @@ if check_network -eq 0; then 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!"; + debug "Network registration is failed!"; fi while true; do @@ -76,7 +76,7 @@ while true; do printf "+" else 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 registration is failed!"; fi sudo pon # check default interface diff --git a/src/reconnect_scripts/reconnect_tracker b/src/reconnect_scripts/reconnect_tracker index cda4543..abb2f92 100644 --- a/src/reconnect_scripts/reconnect_tracker +++ b/src/reconnect_scripts/reconnect_tracker @@ -66,7 +66,7 @@ if check_network -eq 0; then 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!"; + debug "Network registration is failed!"; fi while true; do @@ -89,7 +89,7 @@ while true; do debug "Connection is down, reconnecting..." restart_power if power_up_module -eq 0 ; then sleep 0.1; else debug "Module couldn't be powered up! Check the hardware setup!"; fi - 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 registration is failed!"; fi sudo pon # check default interface