From 410dbe476d19c478bdd534e2f211207e113b536c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 19 Feb 2024 09:08:02 -0600 Subject: [PATCH] update --- defaults.inc | 2 +- nodemgmt-scripts.sh | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/defaults.inc b/defaults.inc index 2656989d..bef0e48a 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='5.1.88-02102024' +VERS='5.1.89-02192024' NM_BETA=false noheader=' service status-check nightlyrephp7.3-fpm,new backup report check checkcerts gitea update-nodes copynpmcerts singleservercheck update-dyndns backup-offsitepfsense gui nightlyreview update log betacheck ' diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index cf87846d..c92ab65a 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1073,7 +1073,7 @@ SETUPSSH(){ echo -e "\n${idsST[Bold]}${idsCL[LightCyan]}Beginning SSH verifiication, you may get prompted for credentials along the way\n" for NTYPE in "${NM_NODE_TYPES[@]}"; do echo -e "${idsST[Bold]}"; DIVIDER - echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes - Verifying SSH Connection${idsCL[Default]}" + echo -e "${idsCL[Yellow]} ${NM_NODETYPES[$NTYPE]}-Nodes - Verifying SSH Connections Between All Nodes${idsCL[Default]}" DIVIDER; echo -e "${idsST[Reset]}" var=${NTYPE}_HOSTS[@] for nip in "${!var}"; do @@ -1089,6 +1089,8 @@ SETUPSSH(){ ssh-copy-id root@${nip} fi + ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} nmg setupssh_back + # echo -en "\n${idsCL[LightCyan]}Verifying NodeMgmt ... ${idsCL[Default]}" # NODEUPDATE ${nip} verify "ssh" @@ -1109,6 +1111,15 @@ SETUPSSH(){ fi 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 @@ -1199,6 +1210,7 @@ GUI(){ fi ;; setupssh) SETUPSSH ${2} ${3} ${4} ${5} ${6};; + setupssh_back) SETUPSSH_BACK ${2} ${3} ${4} ${5} ${6};; betacheck) BETACHECK;; update-dyndns) UPDATE_DYNDNS ${2} ${3} ${4} ${5} ${6};; backup) BACKUP;;