This commit is contained in:
2023-07-01 19:25:19 -05:00
parent b57de4218d
commit 80023027d8
2 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='3.8.241-06272023'
VERS='3.8.242-07012023'
MMFOLDER="/opt/idssys/mediamanager"
TMPFOLDER="${MMFOLDER}/.tmp"

View File

@@ -113,8 +113,9 @@ MMSTART(){
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[LightCyan]}${msg}${spc} ${idsCL[White]}: ${idsCL[Default]}"
echo "REALWANIP=\"$(/usr/bin/dig +short +time=2 myip.opendns.com @208.67.222.222)\"" > ${TMPFOLDER}/realwanip
source ${TMPFOLDER}/realwanip
REALWANIP=$(dig +short txt ch whoami.cloudflare @1.0.0.1)
REALWANIP=${REALWANIP//\"/}
echo "REALWANIP=\"${REALWANIP}\"" > ${TMPFOLDER}/realwanip
"${VPN_START[@]}" >/dev/null 2>&1
sleep 5s
@@ -279,8 +280,9 @@ MMSTART(){
mmip=""
cc=0
until [ "${REALWANIP}" != "" ] && [ "${mmip}" != "" ] && [[ "${REALWANIP}" != *"connection timed out"* ]] && [[ "${mmip}" != *"connection timed out"* ]]; do
# mmip=$(/usr/bin/dig +short myip.opendns.com @resolver1.opendns.com)
mmip=$(/usr/bin/dig +short +time=2 myip.opendns.com @208.67.222.222)
# mmip=$(/usr/bin/dig +short +time=2 myip.opendns.com @208.67.222.222)
mmip=$(dig +short txt ch whoami.cloudflare @1.0.0.1)
mmip=${mmip//\"/}
if [ ${cc} -eq 10 ]; then
echo
echo -e "${idsCL[Red]}Cannot get an WAN address, restarting system!${idsCL[Default]}"
@@ -699,7 +701,9 @@ MMSTATUS(){
echo -en "${idsCL[White]}${msg}${spc}${idsCL[White]} : ${idsCL[Default]}"
# mmip=$(/usr/bin/dig +short myip.opendns.com @resolver1.opendns.com)
mmip=$(/usr/bin/dig +short +time=2 myip.opendns.com @208.67.222.222)
# mmip=$(/usr/bin/dig +short +time=2 myip.opendns.com @208.67.222.222)
mmip=$(dig +short txt ch whoami.cloudflare @1.0.0.1)
mmip=${mmip//\"/}
if [ "${REALWANIP}" != "${mmip}" ]; then
echo -e "${idsCL[Green]}Good${idsCL[Default]}"
else