#!/bin/sh USERNAME="Your_VPN_Username" PASSWORD="Your_VPN_Password" OPVPNENABLE=`nvram get openvpncl_enable | awk '$1 == "0" {print $1}'` if [ "$OPVPNENABLE" != 0 ] then nvram set openvpncl_enable=0 nvram commit fi sleep 10 mkdir /tmp/ironsocket; cd /tmp/ironsocket echo -e "$USERNAME\n$PASSWORD" > userpass.conf echo "#!/bin/sh iptables -I FORWARD -i br0 -o tun0 -j ACCEPT iptables -I FORWARD -i tun0 -o br0 -j ACCEPT iptables -t nat -I POSTROUTING -o tun0 -j MASQUERADE" > route-up.sh echo "#!/bin/sh sleep 2 iptables -t nat -D POSTROUTING -o tun0 -j MASQUERADE" > route-down.sh chmod 600 userpass.conf; chmod 700 route-up.sh route-down.sh sleep 10 # NOTE: Open your client.ovpn profile and copy/paste the content below between ##--BEGIN--## and ##--END--## # Optional: You can exclude comments (i.e. lines that start with #) to minimize the size of openvpn.conf file. # IMPORTANT: Change the line that says 'auth-user-pass' to 'auth-user-pass /tmp/ironsocket/userpass.conf' (without the quotes) echo "##--BEGIN--## (INSERT YOUR CUSTOM PROFILE HERE) ##--END--## log-append /tmp/ironsocket.log script-security 2" > openvpn.conf (killall openvpn; openvpn --config /tmp/ironsocket/openvpn.conf --route-up /tmp/ironsocket/route-up.sh --down /tmp/ironsocket/route-down.sh) & exit 0