diff --git a/defaults.inc b/defaults.inc index ef705e3..2ca1af2 100755 --- a/defaults.inc +++ b/defaults.inc @@ -48,7 +48,11 @@ MMUPDATECHECK(){ } SENDNOTICE(){ - [ "${EMAIL_NOTICE}" != "" ] && echo -e "${2}\n\n$(date)" | mail -s "${1}" ${EMAIL_NOTICE} + # [ "${EMAIL_NOTICE}" != "" ] && echo -e "${2}\n\n$(date)" | mail -s "${1}" ${EMAIL_NOTICE} + [ "${EMAIL_NOTICE}" != "" ] && push_to_mobile "${2} + +$(date)" "${1}" ${3} + } uptime_minutes() { diff --git a/mm-scripts.sh b/mm-scripts.sh index c7db9fd..823e7ea 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -110,7 +110,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf if [ -f ${MMFOLDER}/mm.vpn.fail ]; then echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}" echo "$(date) - VPN Failure #2 - restarting system" >> $logfile - SENDNOTICE "VPN Failure" "2nd Failure, will try and restart the VPN" + SENDNOTICE "VPN Failure" "2nd Failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail2 rm -f ${MMFOLDER}/mm.vpn.fail MMSTOP @@ -122,14 +122,14 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf exit 1 elif [ -f ${MMFOLDER}/mm.vpn.fail2 ]; then echo "$(date) - VPN Failure #3 - Shutting down Media Management systems" >> $logfile - SENDNOTICE "VPN Failure" "Final Failure, shutting down system" + SENDNOTICE "VPN Failure" "Final Failure, shutting down system" 2 MMSTOP [ $VERBOSE = true ] && DEBUGLOGSTOP exit 1 else echo -e "${idsCL[Red]} failed, restarting system${idsCL[Default]}" echo "$(date) - VPN Failure #1 - restarting system" >> $logfile - SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN" + SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP sleep 30s @@ -174,7 +174,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then echo -e "${idsCL[Red]}Could not confirm default routes, restarting system!${idsCL[Default]}" echo "$(date) - Could not confirm default routes, restarting system" >> $logfile - SENDNOTICE "Network Failure" "Default route failure, will try and restart the VPN" + SENDNOTICE "Network Failure" "Default route failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP sleep 2m @@ -204,7 +204,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf echo -e "${idsCL[Red]}Cannot get an WAN address, restarting system!${idsCL[Default]}" echo "$(date) - Cannot get an WAN address, restarting system! scip(${scip}) mmip(${mmip})" >> $logfile [ $VERBOSE = true ] && echo "$(date) - Default Routes: zerogw(${zerogw}) defaultgw(${defaultgw})" >> $logfile - SENDNOTICE "Network Failure" "Cannot get an WAN address, will try and restart the VPN" + SENDNOTICE "Network Failure" "Cannot get an WAN address, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP sleep 2m @@ -224,7 +224,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf echo -e "${idsCL[Red]}Traffic is not routing through VPN, restarting system!${idsCL[Default]}" echo "$(date) - Traffic is not routing through VPN, restarting system! scip(${scip}) mmip(${mmip})" >> $logfile [ $VERBOSE = true ] && echo "$(date) - Default Routes: zerogw(${zerogw}) defaultgw(${defaultgw})" >> $logfile - SENDNOTICE "Network Failure" "Traffic route failure, will try and restart the VPN" + SENDNOTICE "Network Failure" "Traffic route failure, will try and restart the VPN" 1 touch ${MMFOLDER}/mm.vpn.fail MMSTOP sleep 2m @@ -260,7 +260,7 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf fi if [ "${EMAIL_NOTICE}" != "" ] && [ ${PMFS} = true ]; then - SENDNOTICE "Plex Media Not Mounted" "Could not mount the Plex Media Folder" + SENDNOTICE "Plex Media Not Mounted" "Could not mount the Plex Media Folder" 1 touch ${MMFOLDER}/mm.plexmount.fail echo "$(date) - Plex Media could not be mounted" >> $logfile fi