Skip to content

Instantly share code, notes, and snippets.

@dd-han
Created December 26, 2016 06:07
Show Gist options
  • Save dd-han/c49fee3209d69cfebcb3f9c9aa3ea6de to your computer and use it in GitHub Desktop.
Save dd-han/c49fee3209d69cfebcb3f9c9aa3ea6de to your computer and use it in GitHub Desktop.

Revisions

  1. dd-han created this gist Dec 26, 2016.
    17 changes: 17 additions & 0 deletions watchingVPN.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    #!/bin/sh

    failLog='/opt/vpnfail.log'

    sleep 60

    while [ 1 ]; do
    if curl -k https://127.0.0.1/ > /dev/null;then
    date
    echo 'vpnserver fine'
    else
    echo -n 'vpnserver fail at ' > ${failLog}
    date > ${failLog}
    reboot
    fi
    sleep 120
    done