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