From dff703b1e2d29b3dc13633020259ed3e425fea5b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 24 Mar 2023 21:01:29 -0500 Subject: [PATCH] update --- defaults.inc | 5 +++++ mm-scripts.sh | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/defaults.inc b/defaults.inc index 348f69a..27ceb97 100755 --- a/defaults.inc +++ b/defaults.inc @@ -7,6 +7,11 @@ MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) noheader=' check noup stop ' +logfile=${MMFOLDER}/logs/logfile +outputlogfile=${MMFOLDER}/logs/outputs.check.log +[ ! -f ${logfile} ] && touch $logfile +[ ! -f ${outputlogfile} ] && touch $outputlogfile + declare -A NM_SERVICES NM_SERVICES['openvpn']='OpenVPN (TorGuard VPN Tunnel)' NM_SERVICES['wireguard']='WireGuard (TorGuard VPN Tunnel)' diff --git a/mm-scripts.sh b/mm-scripts.sh index 34ccec5..71cf54a 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -25,10 +25,6 @@ if [ "${action}" != "check" ] && [ "${action}" != "update" ] && [ "${2}" != "nou DIVIDER . lightGreen fi -logfile=${MMFOLDER}/logfile - -touch $logfile - IFS=, SERVICES_CHECK=(${SERVICESCHECK}) unset IFS @@ -135,7 +131,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP - sleep 30s + sleep 10s # "${VPN_START[@]}" >/dev/null 2>&1 # sleep 10s rm -f ${MMFOLDER}/mm.stop* @@ -181,7 +177,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf SENDNOTICE "Network Failure" "Default route failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP - sleep 30s + sleep 10s # "${VPN_START[@]}" >/dev/null 2>&1 # sleep 10s rm -f ${MMFOLDER}/mm.stop* @@ -212,7 +208,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf SENDNOTICE "Network Failure" "Cannot get an WAN address, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP >/dev/null 2>&1 - sleep 30s + sleep 10s # "${VPN_START[@]}" >/dev/null 2>&1 # sleep 10s rm -f ${MMFOLDER}/mm.stop* @@ -232,7 +228,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf SENDNOTICE "Network Failure" "Traffic route failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP - sleep 30s + sleep 10s # "${VPN_START[@]}" >/dev/null 2>&1 # sleep 10s rm -f ${MMFOLDER}/mm.stop*