Update mm-scripts.sh

This commit is contained in:
2023-04-22 23:14:10 -05:00
parent ab41e41152
commit 73cde1173f

View File

@@ -115,16 +115,12 @@ MMSTART(){
touch ${MMFOLDER}/mm.vpn.fail2
rm -f ${MMFOLDER}/mm.vpn.fail
MMSTOP
sleep 5m
"${VPN_START[@]}" >/dev/null 2>&1
sleep 10s
OUT=$(/sbin/ip link | grep "$VPN_INTERFACE")
if [ ${#OUT} = 0 ]; then
echo "$(date) - VPN Failure #2 - could not start system" >> $logfile
rm -f ${MMFOLDER}/mm.stop*
[ $VERBOSE = true ] && DEBUGLOGSTOP
exit 1
fi
# sleep 2m
# "${VPN_START[@]}" >/dev/null 2>&1
# sleep 10s
rm -f ${MMFOLDER}/mm.stop*
[ $VERBOSE = true ] && DEBUGLOGSTOP
exit 1
elif [ -f ${MMFOLDER}/mm.vpn.fail2 ]; then
echo "$(date) - VPN Failure #3 - Shutting down Media Management systems" >> $logfile
SENDNOTICE "VPN Failure" "Final Failure, shutting down system" 2
@@ -137,16 +133,12 @@ MMSTART(){
SENDNOTICE "VPN Failure" "1st Failure, will try and restart the VPN" 1
touch ${MMFOLDER}/mm.vpn.fail
MMSTOP
sleep 10s
"${VPN_START[@]}" >/dev/null 2>&1
sleep 10s
OUT=$(/sbin/ip link | grep "$VPN_INTERFACE")
if [ ${#OUT} = 0 ]; then
echo "$(date) - VPN Failure #1 - could not start vpn" >> $logfile
rm -f ${MMFOLDER}/mm.stop*
[ $VERBOSE = true ] && DEBUGLOGSTOP
exit 1
fi
# sleep 10s
# "${VPN_START[@]}" >/dev/null 2>&1
# sleep 10s
rm -f ${MMFOLDER}/mm.stop*
[ $VERBOSE = true ] && DEBUGLOGSTOP
exit 1
fi
fi