Update nodemgmt-scripts.sh

This commit is contained in:
2023-06-30 18:23:41 -05:00
parent 7872646e10
commit 991384626f

View File

@@ -997,8 +997,7 @@ UPDATE_DYNDNS(){
cw_spc=10
echo -e "${idsCL[LightCyan]}Checking for DYNDNS update at ${1^} ... ${idsCL[Default]}"
echo
msg="Old IP:"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[LightCyan]}${msg}${spc}${idsCL[White]}: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}Old IP ${idsCL[White]}: "
fi
if [ "${1}" == "home" ]; then
@@ -1008,12 +1007,11 @@ UPDATE_DYNDNS(){
fi
if [ "${2}" != 'q' ]; then
echo -e "${idsCL[Green]}${OLDIP}"
msg="New IP:"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
echo -en "${idsCL[LightCyan]}${msg}${spc}${idsCL[White]}: ${idsCL[Default]}"
echo -en "${idsCL[LightCyan]}New IP ${idsCL[White]}: "
fi
NEWIP=`dig +short myip.opendns.com @resolver1.opendns.com`
if [ "${2}" != 'q' ]; then
echo -e "${idsCL[Green]}${NEWIP}"
echo -e "${idsCL[LightCyan]}${NEWIP}"
fi
if ([ "${OLDIP}" != "" ] && [ "${NEWIP}" != "" ] && [[ "${NEWIP}" != *";"* ]] && [ "${OLDIP}" != "${NEWIP}" ]) || [ "${2}" == "force" ]; then