diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index ad7ed72c..fd2c98bd 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -359,7 +359,7 @@ NODEUPDATES() { var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do if [ ! -f /tmp/.nodeupdate.${NM_HOSTNAMES[${nip}]// /-}.running ]; then - if [[ ${RUN_NODE_IP} != *"${nip}"* ]]; then + if [ "${RUN_NODE_IP}" != "${nip}" ]; then touch /tmp/.nodeupdate.${NM_HOSTNAMES[${nip}]// /-}.running NODEUPDATE "${nip}" "${2}" "${NMCMD}" & ((ncount++)) @@ -1149,7 +1149,7 @@ SETUPSSH(){ DIVIDER; echo -e "${idsST[Reset]}" var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do - if [[ ${RUN_NODE_IP} != *"${nip}"* ]]; then + if [ "${RUN_NODE_IP}" != "${nip}" ]; then echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Default]}" DIVIDER . lightCyan 40 if [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then @@ -1161,7 +1161,7 @@ SETUPSSH(){ ssh-copy-id root@${nip} fi - ssh root@${nip} "nmg setupssh_back" + # ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip} "nmg setupssh_back" # echo -en "\n${idsCL[LightCyan]}Verifying NodeMgmt ... ${idsCL[Default]}" # NODEUPDATE ${nip} verify "ssh" @@ -1184,6 +1184,16 @@ SETUPSSH(){ done } +SETUPSSH_BACK(){ + echo -en "\n${idsCL[LightCyan]}$(hostname): Checking for Public SSH Key back to Node-Manager ... ${idsCL[Default]}" + if [ "$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${NM_NODEMANAGER} echo ok 2>&1)" == "ok" ]; then + echo -e "${idsCL[Green]}Already Installed${idsCL[Default]}" + else + echo -e "${idsCL[Yellow]}Copying to Node-Manager ...${idsCL[Default]}" + ssh-copy-id root@${NM_NODEMANAGER} + fi +} + SKIP_SERVER_CHECKS(){ if [ ! -f ${NM_TMPFOLDER}/.skip ]; then touch ${NM_TMPFOLDER}/.skip @@ -1247,16 +1257,6 @@ GETSKIP(){ [ -f ${tmpfile}.running ] && mv ${tmpfile}.running ${tmpfile}.done || touch ${tmpfile}.done } -SETUPSSH_BACK(){ - echo -en "\n${idsCL[LightCyan]}Checking for Public SSH Key back to Node-Manager ... ${idsCL[Default]}" - if [ "$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@10.10.10.60 echo ok 2>&1)" == "ok" ]; then - echo -e "${idsCL[Green]}Already Installed${idsCL[Default]}" - else - echo -e "${idsCL[Yellow]}Copying to Node-Manager ...${idsCL[Default]}" - ssh-copy-id root@10.10.10.60 - fi -} - BETACHECK(){ [ "$(curl -sL https://git.schroedercity.com/voltron/NodeMgmt/raw/branch/master/defaults.inc | grep NM_BETA=true)" != "" ] && echo true || echo false }