Update mm-scripts.sh
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user