0

I have a sixfab 4G LTE shield and the module

through which I connect my RPi to cellular data. It requires few commands to be executed in order to connect. How do I make it run only once post startup of RPi each time RPi boots. Tried using bash script but it keeps executing the task continuously. * OS in use : Raspbian Stretch * Raspberry Pi 3B+

Tried putting the commnads in /etc/init.d but it doesn't work as

sudo pppd call gprs after execution does not provide a way to execute some other command without opening a new tab.

I call "sudo pppd call gprs" to run this command. But the issue is I also have to run "sudo route add default ppp0" so that RPi starts connecting to internet using cellular, how do I achieve the route add default task permanently and only execute "call gprs" everytime at boot(this boot part using systemctl)?

EDIT: In short: how do i make RPi connect to Internet over ppp0 only by default instead of executing sudo route add default

1

By a few commands, I believe you are saying "sudo pppd call gprs". May I suggest you check "systemctl".

I ones used that module and it was a part of a system. I called "sudo pppd call gprs" from the script, which was python3. But I called the python script by systemctl. As so systemctl started the python script and python started ppp0. But you can make it direct like "sudo pppd call gprs" called by systemctl.

Check this link for systemctl

  • Yes exactly, I call "sudo pppd call gprs" to run this command. But the issue is I also have to run "sudo route add default ppp0" so that RPi starts connecting to internet using cellular, how do I achieve the route add default task permanently and only execute "call gprs" everytime at boot(this boot part using systemctl)? – Ashwin Phadke Oct 24 '18 at 7:00
  • Now I got your problem correctly. I find something similar to your problem. Check this post, askubuntu.com/questions/1245/add-default-route-on-boot – HVK Oct 24 '18 at 7:15
  • Well that helped, just that should I add sudo pppd call gprs in it too so that both of these execute sequentially. – Ashwin Phadke Oct 24 '18 at 10:34
  • In systemctl right? – HVK Oct 24 '18 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.