subscribe to our Youtube


14455 questions

17168 answers


0 members

We are migrating to our new platform at Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,127 views 12 comments
by anonymous
Dear support. I need my own script automatically start up I put the script line in the rc.local but the script doesn't run! The line to start the scrip is sh /bin/test in the rc.local file before exit 0. How to make it run automatically?

1 Answer

–1 vote
by anonymous


First of all, check if your created script file has set execution permission. To do that, navigate via ssh to the folder where your script is and execute command:

 ls -l

Your output should look something like that:

  • r - refers to read permission.
  • w - refers to write permission.
  • x - refers to execute permission.

If there are none execute permission set, please use this command:

chmod +x

Secondly, edit /etc/sysupgrade.conf file to preserve your script after upgrades. For example my script is in root folder:

Do not forget to save changes!

And lastly, check if you have specified correct script file path in /etc/rc.local file. My file is in root folder so it looks like this:


by anonymous

I found the issue in your script.

Your script starts with 


sleep 5

Change sleep duration to 60 or something longer than 45, because grep function can't find 'Joined LTE network' string until your mobile connection is up. To put it in short, script is executed faster than router connects to network.


by anonymous
What about then sim switch and modem restart?! These cause connection to network faster then reboot?
by anonymous
When you specify your script directory in rc.local file, script automatically starts every time system starts. SIM switch and modem restart is another router features and you need to write your script differently. At least we figured out how to start it, now it is up to you to write correct script using ssh. Sadly, Teltonika staff do not write scripts for customers.

That’s ok. I know that teltonika doesn’t. But for sim switch  and for modem restart what should the beginning? Does my start of script will not work with sim switch and restart the modem?
by anonymous

I suggest to check what strings logread output shows when modem restart and SIM switch events occur and try to use case statement for each scenario. For example:

case word in

      Statement(s) to be executed if pattern1 matches
      Statement(s) to be executed if pattern2 matches
      Statement(s) to be executed if pattern3 matches
     Default condition to be executed