diff --git a/defaults.inc b/defaults.inc index 308fd5b..430d678 100755 --- a/defaults.inc +++ b/defaults.inc @@ -54,5 +54,5 @@ MMUPDATECHECK(){ } SENDNOTICE(){ - [ "${EMAIL_NOTICE}" != "" ] && echo "${2}" | mail -s "${1}" ${EMAIL_NOTICE} + [ "${EMAIL_NOTICE}" != "" ] && echo -e "${2}\n\n$(date)" | mail -s "${1}" ${EMAIL_NOTICE} } \ No newline at end of file diff --git a/mm-scripts.sh b/mm-scripts.sh index 0373b14..14d97f9 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -40,7 +40,7 @@ MMSTART(){ elif [ "${1}" = "check" ] && [ "$(ip link | grep "wg-torguard")" = "" ] && [ ! -f ${MMFOLDER}/mm.vpn* ]; then GOFORSTART=true; - SENDNOTICE "Starting Media Management Systems" "$(date)" + SENDNOTICE "Starting Media Management Systems" "" echo "$(date) - Starting Media Management system - (fresh start)" >> $logfile echo -e "${idsCL[LightCyan]}Fresh startup${idsCL[Default]}" @@ -122,14 +122,14 @@ PersistentKeepalive = 25" >> /etc/wireguard/wg-torguard.conf exit 1 elif [ -f ${MMFOLDER}/mm.vpn.fail2 ]; then echo "$(date) - VPN Failure #3 - Shutting down Media Management systems" >> $logfile - [ "${EMAIL_NOTICE}" != "" ] && echo SENDNOTICE "VPN Failure" "Final Failure, shutting down system" + SENDNOTICE "VPN Failure" "Final Failure, shutting down system" MMSTOP [ $VERBOSE = true ] && DEBUGLOGSTOP exit 1 else echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}" echo "$(date) - VPN Failure #1 - restarting system" >> $logfile - [ "${EMAIL_NOTICE}" != "" ] && echo SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN" + SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN" touch ${MMFOLDER}/mm.vpn.fail MMSTOP sleep 30s