Update mm-scripts.sh

This commit is contained in:
2022-05-13 21:33:54 -05:00
parent 62dff8cdad
commit dd138fa295

View File

@@ -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]}"