Update mm-scripts.sh

This commit is contained in:
2023-05-30 21:56:47 -05:00
parent 44718ea0ec
commit 898a1ff636

View File

@@ -230,11 +230,13 @@ MMSTART(){
defaultgw=$(/bin/ip route show | grep default | cut -d' ' -f 3) defaultgw=$(/bin/ip route show | grep default | cut -d' ' -f 3)
if [ "${zerogw}" == "${defaultgw}" ] && [ "${defaultgw}" == "${VPN_INTERFACE}" ]; then if [ "${zerogw}" == "${defaultgw}" ] && [ "${defaultgw}" == "${VPN_INTERFACE}" ]; then
checked="" checked=""
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
elif [ ${cc} -ge 2 ] && [ "${zerogw}" == "${VPN_INTERFACE}" ] && [ "${defaultgw}" != "${VPN_INTERFACE}" ]; then elif [ ${cc} -eq 1 ] && [ "${zerogw}" == "${VPN_INTERFACE}" ] && [ "${defaultgw}" != "${VPN_INTERFACE}" ]; then
/bin/ip route del default /bin/ip route del default
/bin/ip route add default dev ${VPN_INTERFACE} /bin/ip route add default dev ${VPN_INTERFACE}
SENDNOTICE "MM FIX" "Default route failure, default route re-added" SENDNOTICE "MM FIX" "Default route failure, default route re-added"
echo -en "Fixing... "
elif [ ${cc} -eq 10 ]; then elif [ ${cc} -eq 10 ]; then
echo -e "${idsCL[Red]}Could not confirm default routes, restarting system!${idsCL[Default]}" echo -e "${idsCL[Red]}Could not confirm default routes, restarting system!${idsCL[Default]}"
@@ -258,7 +260,6 @@ MMSTART(){
sleep 1s sleep 1s
done done
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
msg="Verifying traffic routing through VPN" msg="Verifying traffic routing through VPN"
c=0; spc=''; spc1=$((${cw_spc}-${#msg})) c=0; spc=''; spc1=$((${cw_spc}-${#msg}))