Update nodemgmt-scripts.sh

This commit is contained in:
2019-02-06 19:34:46 -06:00
parent f9f632085d
commit 6a5dac2db4

View File

@@ -79,17 +79,14 @@ NEWCERT(){
do_with_root chmod -R 6775 /etc/letsencrypt 2>&1 | tee /opt/idssys/nodemgmt/cert-request.lastrun do_with_root chmod -R 6775 /etc/letsencrypt 2>&1 | tee /opt/idssys/nodemgmt/cert-request.lastrun
yes | cp -rfH /opt/idssys/nodemgmt/cert-request.lastrun /etc/letsencrypt/cert-request.lastrun yes | cp -rfH /opt/idssys/nodemgmt/cert-request.lastrun /etc/letsencrypt/cert-request.lastrun
echo -en "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes... ${idsCL[Default]}" echo -en "${idsCL[LightYellow]}Waiting for certifcate replication between the nodes... ${idsCL[Default]}"
until [ "${synccomplete}" = "true" ]; do until [ "${synccheck}" = "" ]; do
synccomplete=true
for nip in "${NODE_HOSTS[@]}"; do for nip in "${NODE_HOSTS[@]}"; do
if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD='' if [[ $(/sbin/ip -o -4 addr list ens192 | awk '{print $4}' | cut -d/ -f1) == *"${nip}"* ]]; then NCMD=''
else NCMD="ssh root@${nip}" else NCMD="ssh root@${nip}"
fi fi
if [ "${NCMD}" != "" ]; then if [ "${NCMD}" != "" ]; then
check=`${NCMD} "cat /etc/letsencrypt/cert-request.lastrun" | diff - /etc/letsencrypt/cert-request.lastrun` check=`${NCMD} "cat /etc/letsencrypt/cert-request.lastrun" | diff - /etc/letsencrypt/cert-request.lastrun`
if [ "${check}" != "" ]; then synccheck="${synccheck}${check}"
synccomplete=false
fi
fi fi
done done
done done