From 2dd0004ddee28dd770f652ba86a39ee207e63780 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 3 Jun 2022 18:26:58 -0500 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index be084cd..84d6755 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -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