What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Restarting openvpn client from shell

kobari

Occasional Visitor
Hi,

Every once in a while, the VPN client on my Asus router is killing my internet connection (cannot connect anywhere) and restarting it via the web interface restores the internet connection.

I want to write a cron script that checks internet connection every n minutes and restarts it, and as far as I can see killing /etc/openvpn/vpnclient1 process with ps & awk and restarting with:

/etc/openvpn/vpnclient1 --cd /etc/openvpn/client1 --config config.ovpn

works.

Is this safe to do? Is there a better way of doing this?

Thanks
 
Hi,

Every once in a while, the VPN client on my Asus router is killing my internet connection (cannot connect anywhere) and restarting it via the web interface restores the internet connection.

I want to write a cron script that checks internet connection every n minutes and restarts it, and as far as I can see killing /etc/openvpn/vpnclient1 process with ps & awk and restarting with:

/etc/openvpn/vpnclient1 --cd /etc/openvpn/client1 --config config.ovpn

works.

Is this safe to do? Is there a better way of doing this?

Thanks

You could go through the service manager:

Code:
service restart_vpnclient1

That way the router will properly keep track of the state of the VPN client.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top