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
241 views 1 comments
by anonymous
Hi,

uci commit (openvpn) is only to save settings for reboot, right?
Or do any other service/cronjob change my "temp" settings during a long uptime?

I want an OpenVPN with default off setting after reboot (openvpn.VPN.enable='0') and only activate it on demand via:
uci set openvpn.VPN.enable='1' && /etc/init.d/openvpn restart

My script works fine, since I'm new to Teltonika / RUTX08 I will be sure my workflow is right...

1 Answer

0 votes
by anonymous

Hello,

Yes, you are correct. The uci commit command is used to save the current configuration so it will persist after a reboot. Also, you restart the service after the commit, the service will use the new uci configuration. So, if you make changes using uci set but don't commit them, they will be lost when the system restarts.

Hence, if you set openvpn.VPN.enable to 0, and then commit the change, OpenVPN should be disabled by default after a reboot. Though, if you have OpenVPN disabled and you enable it via UCI without restarting the service or rebooting the device, the WebUI may show that VPN is enabled. However, it will actually be disabled until the service is restarted/started or the device is rebooted.

As you have already mentioned, you can enable it on demand using:  

  • uci set openvpn.VPN.enable='1' 
  • uci commit
  • /etc/init.d/openvpn restart

Kind Regards,

Andzej

Best answer
by anonymous

Hello Andzej,

thank you for the reply.

If I commit enable=1 the VPN will (auto)reconnect after reboot, this shouldn't happen!

  • uci set openvpn.VPN.enable='1' 
  • /etc/init.d/openvpn restart

Must work in my case and if someone reboot the VPN is (auto)disabled again.