Schedule: to abort and connect vpn?

Anyone have command or code to enter in schedule tasks to:

abort OpenVPN Client then connect again?

TIA (ThanksInAdvance)

openWRT knows cronjobs …

Just try:

# Stop VPN at 8.20 am
20 8 * * 1,2,3,4,5 /etc/init.d/openvpn stop 

# Start VPN at 17.45 (5.45 PM)
45 17 * * 1,2,3,4,5 /etc/init.d/openvpn start

Or in one Line:

# restart VPN at 4.00 am
00 4 * * 1,2,3,4,5 /etc/init.d/openvpn stop; sleep 5; /etc/init.d/openvpn start

Maybe /etc/init.d/openvpn stop; sleep 5; /etc/init.d/openvpn start can be replaced with simpler /etc/init.d/openvpn restart. Just try the command at the cmd, without cron.

More information about the Service parameter: [OpenWrt Wiki] Managing services

2 Likes