From 5258654a5ba165631ee1586381ba409426492b72 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 23 Feb 2023 21:28:04 -0600 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index 4f44477..1303772 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -246,7 +246,7 @@ MMSTART(){ if [ "${1}" == "start" ]; then #echo -e "${idsCL[LightCyan]}It may take a couple of minutes before all services fully start${idsCL[Default]}" - MMSTATUS full + MMSTATUS fi if [ -f /opt/idssys/mediamanager/mm.vpn.fail* ]; then echo "$(date) - VPN issue has been fixed" >> $logfile @@ -372,7 +372,7 @@ MMSTATUS(){ else echo -e "${idsCL[Green]}Running${idsCL[Default]}" - if [[ ${srvc} == *"vpn"* ]] || [[ ${srvc} == *"wireguard"* ]] || [[ "${1}" == "full" ]]; then + 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 : ${idsCL[Green]}$zerogw${idsCL[Default]}" @@ -387,6 +387,20 @@ MMSTATUS(){ MMSTOP sleep 30s MMSTART + + 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 : ${idsCL[Green]}$zerogw${idsCL[Default]}" + echo -en " |- DEFAULT gateway : " + if [ "${zerogw}" == "${defaultgw}" ] && [ "${zerogw}" == "wg-torguard" ]; then + echo -e "${idsCL[Green]}$defaultgw${idsCL[Default]}" + else + echo -e "${idsCL[Red]}Not correct${idsCL[Default]}" + echo + echo -e "${idsCL[LightCyan]}Shutting down system... fix yo shit${idsCL[Default]}" + MMSTOP + fi + fi fi