FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
290 views 2 comments
by anonymous
Hi, I want to develop a script what executes the following actions when Input(3) is set:

- Disable WAN

- SIM switch

OR: disable all internet connections, to make sure the router only runs local without any remote access.

Thanks! Sander

2 Answers

0 votes
by anonymous

Hello,

  

The following commands will be useful when writing such a script:

  • ubus call ioman.gpio.dout1 status #get the status of the digital input
  • ubus call network.interface.wan down #turn off the WAN IPv4 interface (not disable)
  • ubus call network.interface.wan6 down #turn off the WAN IPv6 interface (not disable)
  • ubus call sim change '{"sim":<SIM_slot>}' #switch the SIM to the specified slot (1 or 2)
  • ubus call network.interface.mob1s1a1 down #turn off the SIM1 interface (not disable)
  • ubus call network.interface.mob1s2a1 down #turn off the SIM2interface (not disable)

These commands could then be used in a script, which will be triggered every minute with a crontab. I do not recommend running the script in a permanent while loop, as that can cause some stability issues.

Let me know if any more information is needed.

  

Best regards,
DaumantasG

by anonymous
Thanks. How can I switch of when the status of input 1 = 0?

Something like: if(input1=0) then switch to profile 'OfflineProfile'

I have found that swichting to another profile, with WAN and LTE connections OFF will do the job, but this does not work during startup. That's why I try to write a startup script, that based on the status of INPUT1 activates the OfflineProfile.

Thanks!
by anonymous

Hello,

  

The profile can be switched by using the command ubus call profile change '{"name":"<name_of_profile>"}'

  

Best regards,
DaumantasG

0 votes
by anonymous

Watch Asian TV shows and movies online for FREE! Korean dramas, Chinese dramas, Taiwanese dramas, Japanese dramas, Kpop & Kdrama