From 357ba20b8ffccbefd21f854b4246580169e4ceb9 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 31 Dec 2022 16:43:05 -0600 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index 8cc7cf8..27a3544 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -34,9 +34,10 @@ MMSTART(){ [ $VERBOSE = true ] && chktmstart=`date +%s` if [ "${1}" = "start" ] || [ "${1}" = "" ]; then GOFORSTART=true; - elif [ "${1}" = "check" ] && [ "$(systemctl is-active openvpn)" != "active" ]; then + elif [ "${1}" = "check" ] && [ "$(systemctl is-active openvpn)" != "active" ] && [ ! -f /opt/mm.vpn* ]; then GOFORSTART=true; - [ "${EMAIL_NOTICE}" != "" ] && echo "2nd Failure, will try and restart the VPN" | mail -s "Media Management systems started" ${EMAIL_NOTICE} + [ "${EMAIL_NOTICE}" != "" ] && echo "" | mail -s "Starting Media Management Systems" ${EMAIL_NOTICE} + echo "$(date) - Starting Media Management system - (openvpn not running)" >> $logfile else GOFORSTART=false; fi