VyprVPN Connection WATCHDOG - Auto Connect on Startup and Reconnect

Hey guys,

Here is a little VyprVPN Connection WATCHDOG script I created to Auto Connect on Startup and Reconnect and check the Connection every 90 Seconds - and then Reconnect if needed.

For this to work you need to Enable the feature to Disable all Connections if VPN is not Connected under VyprVPN > Settings > Disable Connections when VPN is not Connected

How to use:

  1. Copy the script below

  2. Replace “your-admin-username” - with your admin username - eg. admin

  3. Replace “your-admin-password” - with your admin password - eg. password

  4. Replace “your.router.ip.address” - with your routers IP address - eg. 192.168.100.1

  5. Replace “SERVERTOCONNECTTO” with the Server you would like to connect to:
    Name without Spaces - Poland
    Name with Spaces - USA%20-%20Los%20Angeles

  6. Paste the changes code Under Administartion > Scripts > WAN UP:

  7. Reboot router - you can check the logging for the messages - it takes a while to finally connect.

    #!/bin/sh

    seconds between checks

    WATCHDOG_SLEEP_SEC=90

    hostname or IP to ping

    WATCHDOG_SITE=facebook.com

    while sleep $WATCHDOG_SLEEP_SEC
    do
    if ping -c 1 $WATCHDOG_SITE > /tmp/null
    then
    logger “VPN WATCHDOG CONNECTION PING SUCCESS”
    else
    logger “VPN WATCHDOG CONNECTION PING FAILED”
    sleep 4
    if ! ping -c 1 $WATCHDOG_SITE > /tmp/null
    then
    logger “VPN WATCHDOG CONNECTION - RECONNECTING”
    eval wget "http://your-admin-username:your-admin-password@your.router.ip.address/user/cgi-bin/vyprvpn.cgi?[%22VYPRVPN_CONNECT%22,%22SERVERTOCONNECTTO%22,%22Chameleon%22]"
    fi
    fi
    done 2>&1 &

Very neat @dieskim, thanks for posting that!

This should be a good temporary solution to those who would like to have the app connect at router startup. I haven’t personally tested it yet, but I am sure you have extensively :smile:

Nick
Golden Frog Support

Hi,

I don’t understand how it works. Even if VPN is not up, watchdog site is still responding using non vpn connexion…
Have you change something to force all data to use VPN ?

(sorry if bad english, not my natural language)

You have to enable all networking to be disabled when VPN is not connected.

I have uploaded an updated version on the Script to my Github - https://github.com/dieskim/VyprVPN-Router-App-Connection-Watchdog-Auto-Reconnect-and-Connect-on-Startup/blob/master/README.md

1 Like