Update mm-scripts.sh

This commit is contained in:
2023-02-21 18:04:36 -06:00
parent 6112416692
commit 3171ef8c7d

View File

@@ -34,14 +34,23 @@ MMSTART(){
[ $VERBOSE = true ] && chktmstart=`date +%s`
if [ "${1}" = "start" ] || [ "${1}" = "" ]; then
GOFORSTART=true;
elif [ "${1}" = "check" ] && [ "$(ip link | grep "wg-torguard")" = "" ] && [ ! -f /opt/idssys/mediamanager/mm.vpn* ]; then
GOFORSTART=true;
[ "${EMAIL_NOTICE}" != "" ] && echo "" | mail -s "Starting Media Management Systems" ${EMAIL_NOTICE}
echo "$(date) - Starting Media Management system - (wireguard not running)" >> $logfile
echo -e "${idsCL[LightCyan]}Fresh startup${idsCL[Default]}"
elif [ "${1}" = "check" ] && [ "$(ip link | grep "wg-torguard")" = "" ] && [ -f /opt/idssys/mediamanager/mm.vpn* ]; then
GOFORSTART=true;
[ "${EMAIL_NOTICE}" != "" ] && echo "" | mail -s "Starting Media Management Systems" ${EMAIL_NOTICE}
echo "$(date) - Attempting to restart systems after VPN failure..." >> $logfile
echo -e "${idsCL[LightCyan]}Attempting to restart systems after VPN failure...${idsCL[Default]}"
else
GOFORSTART=false;
fi
if [ ${GOFORSTART} = true ]; then
mmsv='Starting'
echo