Update nodemgmt-scripts.sh

This commit is contained in:
2023-11-25 18:21:39 -06:00
parent a866bfdb8c
commit 490a2989f9

View File

@@ -352,7 +352,7 @@ NODEUPDATE() {
c=0; spca=''; spc1=${cw}-${#NODE}; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done c=0; spca=''; spc1=${cw}-${#NODE}; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done
echo -en "Updating ${NODE}${spca}" echo -en "Updating ${NODE}${spca}"
if [ "${nip}" != "100.100.2.1" ] && [ "${nip}" != "10.2.1.1" ] && [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then if [ "${nip}" != "100.100.2.1" ] && [ "${nip}" != "10.2.1.1" ] && [ ! -f ${NM_TMPFOLDER}/${nip}.down ; then
if [ "${2}" != "sync" ]; then if [ "${2}" != "sync" ]; then
echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : " echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : "
if ! ${NCMD} command -v nodemgmt > /dev/null; then if ! ${NCMD} command -v nodemgmt > /dev/null; then
@@ -363,19 +363,19 @@ NODEUPDATE() {
${NCMD} "nodemgmt update q" ${NCMD} "nodemgmt update q"
fi fi
else else
nmdiv=$(${NMCMD} ls -l --time-style=+%s ${NM_FOLDER}/conf/defaults.local.inc | cut -d ' ' -f 6) # nmdiv=$(${NMCMD} ls -l --time-style=+%s ${NM_FOLDER}/conf/defaults.local.inc | cut -d ' ' -f 6)
nmsdc=$(${NMCMD} ls -l --time-style=+%s ${NM_FOLDER}/conf/ssl-domain-checks.conf | cut -d ' ' -f 6) # nmsdc=$(${NMCMD} ls -l --time-style=+%s ${NM_FOLDER}/conf/ssl-domain-checks.conf | cut -d ' ' -f 6)
echo -en " ~ ${idsCL[LightCyan]}Sync Shared Nodemgmt Defaults${idsCL[Default]} : " echo -en " ~ ${idsCL[LightCyan]}Sync Shared Nodemgmt Defaults${idsCL[Default]} : "
if ssh -tq root@${nip} [[ ! -f ${NM_FOLDER}/conf/defaults.local.inc ]] || # if ssh -tq root@${nip} [[ ! -f ${NM_FOLDER}/conf/defaults.local.inc ]] ||
ssh -tq root@${nip} [[ ! -f ${NM_FOLDER}/conf/ssl-domain-checks.conf ]] || # ssh -tq root@${nip} [[ ! -f ${NM_FOLDER}/conf/ssl-domain-checks.conf ]] ||
[ ${nmdiv} -ne $(ssh -tq root@${nip} ls -l --time-style=+%s ${NM_FOLDER}/conf/defaults.local.inc | cut -d ' ' -f 6) ] || # [ ${nmdiv} -ne $(ssh -tq root@${nip} ls -l --time-style=+%s ${NM_FOLDER}/conf/defaults.local.inc | cut -d ' ' -f 6) ] ||
[ ${nmsdc} -ne $(ssh -tq root@${nip} ls -l --time-style=+%s ${NM_FOLDER}/conf/ssl-domain-checks.conf | cut -d ' ' -f 6) ]; then # [ ${nmsdc} -ne $(ssh -tq root@${nip} ls -l --time-style=+%s ${NM_FOLDER}/conf/ssl-domain-checks.conf | cut -d ' ' -f 6) ]; then
${NMCMD} rsync -az ${NM_FOLDER}/conf/defaults.local.inc ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${nip}:${NM_FOLDER}/conf/ & >/dev/null 2>&1 ${NMCMD} rsync -az ${NM_FOLDER}/conf/defaults.local.inc ${NM_FOLDER}/conf/ssl-domain-checks.conf root@${nip}:${NM_FOLDER}/conf/ & >/dev/null 2>&1
echo -e "${idsCL[Green]}Files Synced${idsCL[Default]}" echo -e "${idsCL[Green]}Files Synced${idsCL[Default]}"
else # else
echo -e "${idsCL[Green]}Files Already Synced${idsCL[Default]}" # echo -e "${idsCL[Green]}Files Already Synced${idsCL[Default]}"
fi # fi
fi fi
else else