Butterfly Bones
Very Senior Member
As those who see my posts know, I am a totally scripting inept.
I can understand what goes on with about 70% of a script, but seem to have a total mental block on grasping syntax. Here is what I want to do.
AC86U current RMerlin 384.11_0, with one openvpn client configured that occasionally drops. The "ping-restart 60" does not work with my current VPN provider. I found the VPNFailover script from Martineau that works, but I have tried various options to start from various jffs scripts, and each has a shortcoming for my use. The one that I think is best since I have only one vpn client in use is at the bottom of the help section of the script. I have used it to define vpnclient1-up and vpnclient-down scripts as shown in that script.
vpnclient1-up
vpnclient1-down
I understand they need to be called from the openvpn-event script, and mine is empty, only has a shebang. I have searched and read many threads and found one that references an openvpn-event template by john9527 (here) and I tried that with a cut and paste (remember I don't grok scripting) and get these errors when I manually start and stop the vpnclient1.
I found that template linked in a post in a thread that wanted to add iptables routing with a vpn client event, and I do not need routing other than what is done already with the vpn client start and stop. I guess that template does not do what I want.
I have that vpn client configured to start on boot, and strict client routing in the webGUI.
What I need is to call those vpnclient1-up and vpnclient1-down scripts from openvpn-event. Can anyone please help.
Thank you.

AC86U current RMerlin 384.11_0, with one openvpn client configured that occasionally drops. The "ping-restart 60" does not work with my current VPN provider. I found the VPNFailover script from Martineau that works, but I have tried various options to start from various jffs scripts, and each has a shortcoming for my use. The one that I think is best since I have only one vpn client in use is at the bottom of the help section of the script. I have used it to define vpnclient1-up and vpnclient-down scripts as shown in that script.
Code:
# Script may be initiated by openvpn-event vpnclientX-up ONLY if one VPN Client is ACTIVE at any given time!!!!
#
# VPN_ID=${dev:4:1}
# sh /jffs/scripts/VPN_Failover.sh $VPN_ID wait=10 &
#
# and also needs to be terminated by openvpn-event vpnclientX-down
# rm "/tmp/vpnclient"$VPN_ID"-monitor"
#
Code:
#!/bin/sh
VPN_ID=${dev:4:1}
sh /jffs/scripts/VPN_Failover.sh $VPN_ID wait=10 &
Code:
#!/bin/sh
rm "/tmp/vpnclient"$VPN_ID"-monitor"
Code:
May 8 09:48:23 RT-AC86U-4608 custom_script: Running /jffs/scripts/service-event (args: start vpnclient1)
May 8 09:48:37 RT-AC86U-4608 openvpn-event[28259]: Script not defined for event: vpnclient1-route-up
May 8 09:52:47 RT-AC86U-4608 rc_service: httpds 11045:notify_rc stop_vpnclient1
May 8 09:52:47 RT-AC86U-4608 custom_script: Running /jffs/scripts/service-event (args: stop vpnclient1)
May 8 09:52:48 RT-AC86U-4608 openvpn-event[29028]: Script not defined for event: vpnclient1-route-pre-down
I have that vpn client configured to start on boot, and strict client routing in the webGUI.
What I need is to call those vpnclient1-up and vpnclient1-down scripts from openvpn-event. Can anyone please help.
Thank you.
Last edited: