This commit is contained in:
2024-04-24 12:11:22 -05:00
parent 94fa3be370
commit 882679126b
2 changed files with 20 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='5.1.105-04242024'
VERS='5.1.106-04242024'
NM_BETA=false
noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log betacheck offsite-staticroute-fix '

View File

@@ -26,10 +26,26 @@ fi
OFFSITE_STATICROUTE_FIX(){
if [ "$(CHECK_HOST 10.10.0.1)" != "true" ]; then
if [ "$(CHECK_HOST ${NM_OFFSITE_GW_IP})" != "false" ] && [ "$(CHECK_HOST 10.5.0.1)" != "false" ] && [ "$(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)
SENDNOTICE "Static Route to Homesite Missing" "Re-added the static route onto the UniFi Gateway"
if [ "$(CHECK_HOST ${NM_OFFSITE_GW_IP})" != "false" ]; then
if [ "$(CHECK_HOST 10.5.0.1)" != "false" ]; then
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
SENDNOTICE "Static Route to Homesite Missing" "Re-added the static route onto the Offsite UniFi Gateway"
else
SENDNOTICE "ERROR: Static Route to Homesite Missing" "Cannot add the static route onto the Offsite UniFi Gateway" 1
fi
fi
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
SENDNOTICE "VPN to Homesite Down" "FiX'yO ShiTTy A$$ VPN"
fi
fi
fi
else
rm -f ${NM_TMPFOLDER}/vpn-tunnel*
fi
}