From 98df4a1e8363807d5da40934ea8202a28967b773 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 23 Feb 2023 20:32:59 -0600 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index 9b6e40c..c3b7370 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -372,22 +372,22 @@ MMSTATUS(){ else echo -e "${idsCL[Green]}Running${idsCL[Default]}" if [[ ${srvc} == *"vpn"* ]] || [[ ${srvc} == *"wireguard"* ]]; then - # zerogw=$(ip route show | grep 0.0.0.0 | cut -d' ' -f 3) - # defaultgw=$(ip route show | grep default | cut -d' ' -f 3) - # echo -e " |- 0.0.0.0 gateway --> (${zerogw})" - # echo -en " |- DEFAULT gateway --> (${defaultgw}) : " - # if [ "${zerogw}" = "${defaultgw}" ]; then - # echo -e "${idsCL[Green]}Matches 0.0.0.0 route${idsCL[Default]}" - # else - # echo -e "${idsCL[Red]}Does not match 0.0.0.0 route${idsCL[Default]}" - # if [ ! -f /opt/idssys/mediamanager/mm.stop ]; then - # echo - # echo -e "${idsCL[LightCyan]}Restarting system...${idsCL[Default]}" - # MMSTOP - # sleep 30s - # MMSTART - # fi - # fi + zerogw=$(ip route show | grep 0.0.0.0 | cut -d' ' -f 3) + defaultgw=$(ip route show | grep default | cut -d' ' -f 3) + echo -e " |- 0.0.0.0 gateway --> (${zerogw})" + echo -en " |- DEFAULT gateway --> (${defaultgw}) : " + if [ "${zerogw}" = "${defaultgw}" ]; then + echo -e "${idsCL[Green]}Matches 0.0.0.0 route${idsCL[Default]}" + else + echo -e "${idsCL[Red]}Does not match 0.0.0.0 route${idsCL[Default]}" + if [ ! -f /opt/idssys/mediamanager/mm.stop ]; then + echo + echo -e "${idsCL[LightCyan]}Restarting system...${idsCL[Default]}" + MMSTOP + sleep 30s + MMSTART + fi + fi echo -en " |- Verify traffic route to VPN -> : " scip=$(dig +short sc1.scity.us @9.9.9.9)