Update mm-scripts.sh

This commit is contained in:
2022-06-03 18:26:58 -05:00
parent b6d968b806
commit 2dd0004dde

View File

@@ -114,24 +114,16 @@ MMSTART(){
echo -en "${idsCL[LightCyan]}Verifing traffic is routing through VPN... ${idsCL[Default]}"
checked=false
cc=0
until [ "${checked}" = "" ]; do
scip=$(dig +short sc1.scity.us @ns1.scity.us)
mmip=$(dig +short myip.opendns.com @resolver1.opendns.com)
if [ "${scip}" != "${mmip}" ]; then
checked=""
fi
if [ "${checked}" == "false" ] && [ ${cc} -eq 10 ]; then
echo -e "${idsCL[Red]}Traffic is not routing through VPN!${idsCL[Default]}"
echo "$(date) - Traffic is not routing through VPN, shutting down" >> $logfile
MMSTOP
exit 1
fi
((cc=${cc}+1))
sleep 1s
done
echo -e "${idsCL[Green]} done${idsCL[Default]}"
scip=$(dig +short sc1.scity.us @ns1.scity.us)
mmip=$(dig +short myip.opendns.com @resolver1.opendns.com)
if [ "${scip}" != "${mmip}" ]; then
echo -e "${idsCL[Green]} done${idsCL[Default]}"
else
echo -e "${idsCL[Red]}Traffic is not routing through VPN!${idsCL[Default]}"
echo "$(date) - Traffic is not routing through VPN, shutting down" >> $logfile
MMSTOP
exit 1
fi
echo
@@ -266,7 +258,7 @@ MMSTATUS(){
if [ "${scip}" != "${mmip}" ]; then
echo -e "${idsCL[Green]}Good${idsCL[Default]}"
else
echo -e "${idsCL[Red]}Not routing through VPN${idsCL[Default]}"
echo -e "${idsCL[Red]}Not Good${idsCL[Default]}"
fi
echo