WinSCP can only upload and edit files (unless i have missed the commandline).
And Putty is the other way around, it can’t upload files, but it can do all commands.
That also means that its possible to edit and create files using commands and for example Nano, but you need to install Nano on your router by doing:
opkg update && opkg install nano
I personally use this method. Vi already comes installed on the device but i don’t really like it as an editor.
Yeah Nano runs in the router. You can just download something like JuiceSSH if you are on Android to connect to your router, and then just type:
(After you install nano)
You will then get something that resembles notepad but remotely, and you can type there, paste entire scripts, and then save the file using cntrl+o, and quit using cntrl+x.
Putty is just an SSH terminal program, so the learning part is because you will be able to access all the configuration files on the router and edit them. The GL UI is basically changing configuration files in the background, so you would be able to do the same, but manually and for more advanced configurations.
So I’ll just have to make a new vpn_reconnect.txt file, insert in in the /usr/bin by using WinSCP, then let the script happen in the background?
The script is
#wait for the openvpn to connect for the first time
while [ true ]; do
#check if openvpn is enabled, if not, go to next loop
vpn_enabled=$(uci get glconfig.openvpn.enable)
if [ “$vpn_enabled” != “1” ]; then
echo “VPN not enabled, check 20 seconds later”
if [ -z “$tun0_ifname” ] && [ -z “$vpn_pid” ]; then
echo “VPN enabled but not running, restarting it”
echo “VPN is connected and connecting, check 20 seconds later”