mirror of
https://github.com/sixfab/Sixfab_PPP_Installer
synced 2024-11-14 15:24:52 +00:00
commit
762f9f390f
@ -26,24 +26,6 @@ case $shield_hat in
|
||||
*) echo "${RED}Wrong Selection, exiting${SET}"; exit 1;
|
||||
esac
|
||||
|
||||
if [ $shield_hat -eq 3 ] || [ $shield_hat -eq 4 ]; then
|
||||
echo "${YELLOW}Please choose LTE Technology:${SET}"
|
||||
echo "${YELLOW}1: GPRS/EDGE${SET}"
|
||||
echo "${YELLOW}2: CATM1${SET}"
|
||||
echo "${YELLOW}3: NB-IoT${SET}"
|
||||
|
||||
read network_technology
|
||||
case $network_technology in
|
||||
1) echo "${YELLOW}You chose GPRS/EDGE${SET}"
|
||||
EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",01,1\nOK AT+QCFG="nwscanmode",1,1\nOK AT+QCFG="iotopmode",2,1';;
|
||||
2) echo "${YELLOW}You chose CATM1${SET}"
|
||||
EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",02,1\nOK AT+QCFG="nwscanmode",3,1\nOK AT+QCFG="iotopmode",0,1';;
|
||||
3) echo "${YELLOW}You chose NB-IoT${SET}"
|
||||
EXTRA='OK AT+QCFG="band",F,400A0E189F,A0E189F,1\nOK AT+QCFG="nwscanseq",03,1\nOK AT+QCFG="nwscanmode",3,1\nOK AT+QCFG="iotopmode",1,1';;
|
||||
*) echo "{RED}Wrong Selection, exiting${SET}"; exit 1;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "${YELLOW}Downloading setup files${SET}"
|
||||
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/chat-connect -O chat-connect
|
||||
|
||||
@ -101,11 +83,7 @@ echo "${YELLOW}What is your device communication PORT? (ttyS0/ttyUSB3/etc.)${SET
|
||||
read devicename
|
||||
|
||||
mkdir -p /etc/chatscripts
|
||||
if [ $shield_hat -eq 3 ] || [ $shield_hat -eq 4 ]; then
|
||||
sed -i "s/#EXTRA/$EXTRA/" chat-connect
|
||||
else
|
||||
sed -i "/#EXTRA/d" chat-connect
|
||||
fi
|
||||
sed -i "/#EXTRA/d" chat-connect
|
||||
|
||||
mv chat-connect /etc/chatscripts/
|
||||
mv chat-disconnect /etc/chatscripts/
|
||||
@ -120,47 +98,5 @@ if ! (grep -q 'sudo route' /etc/ppp/ip-up ); then
|
||||
echo "sudo route add default ppp0" >> /etc/ppp/ip-up
|
||||
fi
|
||||
|
||||
while [ 1 ]
|
||||
do
|
||||
echo "${YELLOW}Do you want to activate auto connect/reconnect service at R.Pi boot up? [Y/n] ${SET}"
|
||||
read auto_reconnect
|
||||
|
||||
case $auto_reconnect in
|
||||
[Yy]* ) echo "${YELLOW}Downloading setup file${SET}"
|
||||
|
||||
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_service -O reconnect.service
|
||||
|
||||
if [ $shield_hat -eq 1 ]; then
|
||||
|
||||
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_gprsshield -O reconnect.sh
|
||||
|
||||
elif [ $shield_hat -eq 2 ]; then
|
||||
|
||||
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_baseshield -O reconnect.sh
|
||||
|
||||
elif [ $shield_hat -eq 3 ]; then
|
||||
|
||||
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_cellulariot_app -O reconnect.sh
|
||||
|
||||
elif [ $shield_hat -eq 4 ]; then
|
||||
|
||||
wget --no-check-certificate https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/reconnect_cellulariot -O reconnect.sh
|
||||
fi
|
||||
|
||||
mv reconnect.sh /usr/src/
|
||||
mv reconnect.service /etc/systemd/system/
|
||||
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable reconnect.service
|
||||
|
||||
break;;
|
||||
|
||||
[Nn]* ) echo "${YELLOW}To connect to internet run ${BLUE}\"sudo pon\"${YELLOW} and to disconnect run ${BLUE}\"sudo poff\" ${SET}"
|
||||
break;;
|
||||
*) echo "${RED}Wrong Selection, Select among Y or n${SET}";;
|
||||
esac
|
||||
done
|
||||
|
||||
read -p "Press ENTER key to reboot" ENTER
|
||||
reboot
|
Loading…
Reference in New Issue
Block a user