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