OpenVPN not reliable, use VPNCHECK

  • I have two sites with 24h DAIP. After hours of troubleshooting, it was horrible for me to find out that openVPN doesn’t work properly.
    So I have build this simple loop to check the connection and perform a reconnect if it necessary.

    vcheck ()
    echo "vcheck"
    PTEST=`ping -c 1 -t 1 | grep "100% packet loss" | awk '{print $1;}'`
    HPID=`cat /var/run/`
    if [ "X${PTEST}" != "X" ] ; then
            echo ""
            echo "No connection to Heinsberg!"
            echo ""
            kill $HPID
            sleep 5
            openvpn --config /var/etc/openvpn_client0.conf
            echo ""
            echo "Connected to Heinsberg!"
            echo ""
    vwait ()
    echo "vwait"
    sleep 30

    How can I start that loop automatically, after reboot and established pppoe session?

  • Try the latest snapshot.

  • @sullrich:

    Try the latest snapshot.

    That will start my loop?  :D
    Ok in the latest snapshot are some improvements, I will give it a try. But how can I start my Script on boot?  ::) It should be starded as a daemon…  :'(

  • You can start custom stuff on boot/filterreload by using hidden config.xml options:

  • Look in the package area.  There is a rc.d thread that is a sticky.

Log in to reply