In case anyone else finds this useful I am automatically updating the password for the vpnbook openvpn client which changes periodically.
In the custom configuration section of the openvpn client I have this line pointing to the username and password file:
Then in my wan start
So now when the wan comes up the openvpn client starts with the current vpn username and password.
I was looking into running the script also with a pre-up parameter as well so if the client is started manually the password would be updated but I dont think that is supported.
I have added another option into the custom config
which again runs:
Am I right in thinking that if the connection drops due to a password change or for some other reason (not a complete wan fail) and I have the poll interval set the password will update and the client will attempt to reconnect with the new password or would it be best to add in a " service restart_vpnclient1" to that script. I presume the wan-start script would kick in again if I had a complete wan outage and it came back up.
In the custom configuration section of the openvpn client I have this line pointing to the username and password file:
Code:
auth-user-pass /opt/tmp/user.conf
Then in my wan start
Code:
curl -s "http://www.vpnbook.com" | grep -A 1 "Username: vpnbook" | tail -n 2| cut -f2 -d " " | cut -f1 -d '<' > /opt/tmp/user.conf
sleep 60
service start_vpnclient1
So now when the wan comes up the openvpn client starts with the current vpn username and password.
I was looking into running the script also with a pre-up parameter as well so if the client is started manually the password would be updated but I dont think that is supported.
I have added another option into the custom config
Code:
down /jffs/scripts/vpnbook.sh
which again runs:
Code:
curl -s "http://www.vpnbook.com" | grep -A 1 "Username: vpnbook" | tail -n 2| cut -f2 -d " " | cut -f1 -d '<' > /opt/tmp/user.conf
Am I right in thinking that if the connection drops due to a password change or for some other reason (not a complete wan fail) and I have the poll interval set the password will update and the client will attempt to reconnect with the new password or would it be best to add in a " service restart_vpnclient1" to that script. I presume the wan-start script would kick in again if I had a complete wan outage and it came back up.
Last edited: