diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 62b17763..7a49e08d 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -744,8 +744,14 @@ SETUPSSH(){ echo -e " ${idsST[Bold]}${idsCL[LightCyan]}${NM_HOSTNAMES[${nip}]}[${nip}]${idsST[Reset]}${idsCL[Default]}" DIVIDER . lightCyan 40 if [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then - echo -e "\n${idsCL[LightCyan]}Copying Public SSH Key ...${idsCL[Default]}" - ssh-copy-id root@${nip} + echo -en "\n${idsCL[LightCyan]}Checking for Public SSH Key ... ${idsCL[Default]}" + if [ "$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1)" == "ok" ]; then + echo -e "\n${idsCL[Green]}Already Installed${idsCL[Default]}" + else + echo -e "\n${idsCL[Yellow]}Copying to Host ...${idsCL[Default]}" + ssh-copy-id root@${nip} + fi + echo -en "\n${idsCL[LightCyan]}Verifying NodeMgmt ... ${idsCL[Default]}" NODEUPDATE ${nip} verify "ssh" else