I’m trying to write a script for my GL-AR300M button that starts and stops the OpenVPN client. This is my BTN_1 script so far.
#!/bin/sh
#This is the switch of AR300M, left pressed, release right
if [ “$ACTION” = “released” ]; then
uci set glconfig.openvpn.enable=1
uci commit glconfig
/etc/init.d/startvpn start
else
uci set glconfig.openvpn.enable=0
uci commit glconfig
/etc/init.d/startvpn stop
fi
This works so far and will start and stop the OpenVPN client, however it does not create the VPN_Client interface (tun 0). How do I create and remove the VPN_Client interface with the script?