From 12f3bf79d24c79f4340cbf9a0977db3099fb0d61 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 4 Jul 2023 11:59:28 -0500 Subject: [PATCH] Update nodemgmt-scripts.sh --- nodemgmt-scripts.sh | 48 +++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 1462e220..9cdce429 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -782,12 +782,16 @@ NODEUPDATE() { if [[ $(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1) == *"${nmip}"* ]]; then nmip='localhost' fi - c=0; cw=24; spca=''; spc1=${cw}-7; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done - echo -en "Updating Node-Manager[$nmip]${spca} ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : " - ssh -tq root@${nmip} "nodemgmt update q" - echo -en "${idsCL[Green]}COMPLETE${idsCL[Default]} ~ ${idsCL[LightCyan]}LinUPx${idsCL[Default]} : " - ssh -tq root@${nmip} "runup runup" - echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" + + if [ "${2}" != "sync" ]; then + c=0; cw=24; spca=''; spc1=${cw}-7; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done + echo -en "Updating Node-Manager[$nmip]${spca} ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : " + ssh -tq root@${nmip} "nodemgmt update q" + echo -en "${idsCL[Green]}COMPLETE${idsCL[Default]} ~ ${idsCL[LightCyan]}LinUPx${idsCL[Default]} : " + ssh -tq root@${nmip} "runup runup" + echo -e "${idsCL[Green]}COMPLETE${idsCL[Default]}" + fi + echo for NTYPE in "${NODE_TYPES[@]}"; do nid=1 @@ -801,21 +805,23 @@ NODEUPDATE() { c=0; cw=40; spca=''; spc1=${cw}-${#NODE}; until [ $c = ${spc1} ]; do spca="${spca} "; c=`expr $c + 1`; done echo -en "Updating ${NODE}${spca}" -# echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : " -# if ! ${NCMD} command -v nodemgmt > /dev/null; then -# ${NCMD} "bash <(curl -sL https://go.scity.us/install-nodemgmt)" >/dev/null 2>&1 -# else -# ${NCMD} "nodemgmt update q" >/dev/null 2>&1 -# fi -# \ echo -en "${idsCL[Green]}COMPLETE${idsCL[Default]}" -# -# echo -en " ~ ${idsCL[LightCyan]}LinUPx${idsCL[Default]} : " -# if ! ${NCMD} command -v runup > /dev/null; then -# ${NCMD} bash <(curl -sL https://go.scity.us/install-linupx) >/dev/null 2>&1 -# else -# ${NCMD} "runup runup" >/dev/null 2>&1 -# fi -# echo -en "${idsCL[Green]}COMPLETE${idsCL[Default]}" + if [ "${2}" != "sync" ]; then + echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : " + if ! ${NCMD} command -v nodemgmt > /dev/null; then + ${NCMD} "bash <(curl -sL https://go.scity.us/install-nodemgmt)" >/dev/null 2>&1 + else + ${NCMD} "nodemgmt update q" >/dev/null 2>&1 + fi + \ echo -en "${idsCL[Green]}COMPLETE${idsCL[Default]}" + + echo -en " ~ ${idsCL[LightCyan]}LinUPx${idsCL[Default]} : " + if ! ${NCMD} command -v runup > /dev/null; then + ${NCMD} bash <(curl -sL https://go.scity.us/install-linupx) >/dev/null 2>&1 + else + ${NCMD} "runup runup" >/dev/null 2>&1 + fi + echo -en "${idsCL[Green]}COMPLETE${idsCL[Default]}" + fi echo -en " ~ ${idsCL[LightCyan]}Sync Defaults${idsCL[Default]} : " if [ $(ssh -tq root@${nmip} ls -l --time-style=+%s ${NM_FOLDER}/defaults.local.inc | cut -d ' ' -f 6) -ne $(ssh -tq root@${nip} ls -l --time-style=+%s ${NM_FOLDER}/defaults.local.inc | cut -d ' ' -f 6) ]; then