Could you share how you do this? I haven't been able to figure out how the vpn_client* variables become the dynamically generated configuration in /etc/openvpn/client*...manually start the appropriate VPN during the boot
Could you share how you do this? I haven't been able to figure out how the vpn_client* variables become the dynamically generated configuration in /etc/openvpn/client*...manually start the appropriate VPN during the boot
I use the following logic in nat-startCould you share how you do this? I haven't been able to figure out how the vpn_client* variables become the dynamically generated configuration in /etc/openvpn/client*...
# Check if VPN client is UP, or if we are in BOOT mode and "Automatic start at boot time=NO"
[ -f /tmp/BOOTINPROGRESS ] && ACTION="on" || ACTION="restart" # Semaphore created/deleted in init-start
VPN_LIST="1 2"
for VPNID in $VPN_LIST
do
NVRAM_STATE=$(nvram get vpn_client${VPNID}_state) # 0=Disconnected;1=Connecting,2=Connected
logger -t "($(basename $0))" "Checking if VPN Client$VPNID is UP...."
if [ "$NVRAM_STATE" == "2" ] || [ -f /tmp/BOOTINPROGRESS ];then
service restart_vpnclient$VPNID # Bounce or initialise the VPN Client
#/jffs/scripts/VPN_Client_Switch.sh $VPNID $ACTION # My custom script
#sleep 60 # Cosmetic...keeps Syslog tidy
fi
done
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!