Update mm-scripts.sh

This commit is contained in:
2023-05-30 21:52:24 -05:00
parent 5da3767217
commit 44718ea0ec

View File

@@ -228,15 +228,15 @@ MMSTART(){
until [ "${checked}" = "" ]; do
zerogw=$(/bin/ip route show | grep 0.0.0.0 | cut -d' ' -f 3)
defaultgw=$(/bin/ip route show | grep default | cut -d' ' -f 3)
if [ "${zerogw}" = "${defaultgw}" ]; then
if [ "${zerogw}" == "${defaultgw}" ] && [ "${defaultgw}" == "${VPN_INTERFACE}" ]; then
checked=""
elif [ "${checked}" == "false" ] && [ ${cc} -ge 2 ]; then
elif [ ${cc} -ge 2 ] && [ "${zerogw}" == "${VPN_INTERFACE}" ] && [ "${defaultgw}" != "${VPN_INTERFACE}" ]; then
/bin/ip route del default
/bin/ip route add default dev ${VPN_INTERFACE}
SENDNOTICE "MM FIX" "Default route failure, default route re-added"
elif [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
elif [ ${cc} -eq 10 ]; then
echo -e "${idsCL[Red]}Could not confirm default routes, restarting system!${idsCL[Default]}"
echo "$(date) - Could not confirm default routes, restarting system" >> $logfile
SENDNOTICE "Network Failure" "Default route failure, will try and restart the VPN" 1