Update mm-scripts.sh

This commit is contained in:
2022-04-18 20:57:30 -05:00
parent c1d2d20a65
commit b5743b09b0

View File

@@ -23,6 +23,7 @@ unset IFS
MMSTART(){
if [ "${1}" = "start" ]; then
mmsv='Starting'
echo
echo -en "${idsCL[Green]}Starting the VPN Tunnel ... ${idsCL[Default]}"
"${VPN_START[@]}"
else
@@ -72,6 +73,7 @@ MMSTART(){
/bin/ip route add default via $(ip route show | grep 0.0.0.0 | cut -d' ' -f 3)
echo -e "${idsCL[Green]} done${idsCL[Default]}"
echo
echo -en "${idsCL[LightCyan]}${mmsv} Services... ${idsCL[Default]}"
for srvc in "${SERVICES_CHECK[@]}"; do
/bin/systemctl start ${srvc}
@@ -170,6 +172,12 @@ MMSTATUS(){
echo -e "${idsCL[Red]}Not Running${idsCL[Default]}"
else
echo -e "${idsCL[Green]}Running${idsCL[Default]}"
if [[ ${srvc} == *"vpn"* ]]; then
zerogw=$(netstat -r | grep '0.0.0.0' | head -1 | awk '{ print $2}')
defaultgw=$(netstat -r | grep 'default' | head -1 | awk '{ print $2}')
echo -e " -- 0.0.0.0 gateway --> (${zerogw})"
echo -e " -- DEFAULT gateway --> (${defaultgw})"
fi
fi
fi