Update mm-scripts.sh

This commit is contained in:
2023-04-22 22:57:50 -05:00
parent 801b5c6ac1
commit c6aa673627

View File

@@ -148,9 +148,13 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
sleep 5m
"${VPN_START[@]}" >/dev/null 2>&1
sleep 10s
# rm -f ${MMFOLDER}/mm.stop*
# [ $VERBOSE = true ] && DEBUGLOGSTOP
# exit 1
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
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
@@ -166,12 +170,18 @@ PersistentKeepalive = 25" >> /etc/wireguard/${VPN_INTERFACE}.conf
sleep 10s
"${VPN_START[@]}" >/dev/null 2>&1
sleep 10s
# rm -f ${MMFOLDER}/mm.stop*
# [ $VERBOSE = true ] && DEBUGLOGSTOP
# exit 1
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
fi
fi
else
OUT=$(/sbin/ip link | grep "$VPN_INTERFACE")
if [ ${#OUT} != 0 ]; then
if [ ${GOFORSTART} = true ] || [ "${1}" == "check" ]; then
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
fi