mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2024-11-24 11:54:54 +00:00
Merge pull request #23 from adrianboimvaser/master
Use `replacedefaultroute` in `/etc/ppp/peers/provider` instead of `sudo route add default ppp0` + fix typos
This commit is contained in:
commit
0ffaf6a265
@ -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
|
||||
|
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user