From dd138fa295cb924d9a7de32e2e20553c5a58eb11 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 13 May 2022 21:33:54 -0500 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index ab38ccc..8d30aac 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -15,6 +15,10 @@ if [ "${action}" != "check" ] && [ "${action}" != "update" ]; then DIVIDER . lightGreen fi +logfile=/opt/idssys/mediamanager/logfile + +touch $logfile + IFS=, SERVICES_CHECK=(${SERVICESCHECK}) @@ -39,6 +43,7 @@ MMSTART(){ checked="" elif [ "${1}" = "check" ] && [ ${cc} -eq 0 ]; then touch /opt/mm.vpn.fail + echo date " - VPN Failure on 1st check" >> $logfile MMSTOP sleep 1m "${VPN_START[@]}" @@ -47,6 +52,7 @@ MMSTART(){ fi if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then if [ -f /opt/mm.vpn.fail ]; then + echo date " - VPN Failure #2" >> $logfile touch /opt/mm.vpn.fail2 rm -f /opt/mm.vpn.fail MMSTOP @@ -55,9 +61,11 @@ MMSTART(){ rm -f /opt/mm.stop exit 1 elif [ -f /opt/mm.vpn.fail2 ]; then + echo date " - VPN Failure #3 - Shutting down Media Management systems" >> $logfile MMSTOP exit 1 else + echo date " - VPN Failure #1" >> $logfile touch /opt/mm.vpn.fail MMSTOP sleep 1m @@ -113,6 +121,7 @@ MMSTART(){ echo -e "${idsCL[LightCyan]}It may take a couple of minutes before all systems fully start${idsCL[Default]}" echo fi + echo date " - Media Management systems started" >> $logfile rm -f /opt/mm.stop rm -f /opt/mm.vpn.fail* echo @@ -172,7 +181,7 @@ MMSTOP(){ checked="" fi done - + echo date " - Media Management systems stopped" >> $logfile /bin/ip route add default via 10.10.0.1 echo -e "${idsCL[Green]} done${idsCL[Default]}"