Update mm-scripts.sh

This commit is contained in:
2023-02-23 20:32:59 -06:00
parent d3fae63bfc
commit 98df4a1e83

View File

@@ -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)