diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 37753472..e6b47e38 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -28,6 +28,9 @@ OFFSITE_STATICROUTE_FIX(){ if [ "$(CHECK_HOST 10.10.0.1)" != "true" ]; then if [ "$(CHECK_HOST ${NM_OFFSITE_GW_IP})" != "false" ]; then if [ "$(CHECK_HOST 10.5.0.1)" != "false" ]; then + if [ -f ${NM_TMPFOLDER}/vpn-tunnel.down ]; then + SENDNOTICE "VPN to Homesite is Back Up" "VPN Tunnel is up" + fi if [ "$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${NM_OFFSITE_GW_IP} ip r | grep 10.10.0.0)" = "" ]; then RUN=$(ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${NM_OFFSITE_GW_IP} ip r add 10.10.0.0/16 dev wgsts1000 2>&1 >/dev/null) if [ "${RUN}" == "" ]; then @@ -39,7 +42,7 @@ OFFSITE_STATICROUTE_FIX(){ else if [ ! -f ${NM_TMPFOLDER}/vpn-tunnel.down ]; then touch ${NM_TMPFOLDER}/vpn-tunnel.down - elif [ $(expr `date +%s` - $(stat -c %Y ${NM_TMPFOLDER}/vpn-tunnel.down)) -ge 300 ]; then + elif [ $(expr `date +%s` - $(stat -c %Y ${NM_TMPFOLDER}/vpn-tunnel.down)) -ge 60 ]; then SENDNOTICE "VPN to Homesite Down" "FiX'yO ShiTTy A$$ VPN" fi fi