diff --git a/defaults.inc b/defaults.inc index a5d81218..818e2fc7 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERS='5.3.8-11292024' +VERS='5.3.9-11292024' 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 offsite-staticroute-fix ' diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 24d190ef..5f85fdf1 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -1172,6 +1172,57 @@ SKIP_SERVER_CHECKS(){ echo } +LIST_SKIPPED_SERVERS(){ + cw=40; + rm -f /tmp/.nodeskipcheck.* + echo + declare -i spc1; declare -i c + echo -e "${idsCL[LightGreen]}Checked for Skipped Nodes${idsCL[Default]}" + echo -e "${idsCL[LightGreen]}-------------------------------------------${idsCL[Default]}" + + ncount=0 + for NTYPE in "${NM_NODE_TYPES[@]}"; do + var=${NTYPE}_HOSTS[@] + for nip in "${!var}"; do + if [ ! -f /tmp/.nodeskipcheck.${NM_HOSTNAMES[${nip}]// /-}.running ]; then + if [[ ${RUN_NODE_IP} != *"${nip}"* ]]; then + touch /tmp/.nodeupdate.${NM_HOSTNAMES[${nip}]// /-}.running + GETSKIP "${nip}" & + ((ncount++)) + fi + fi + done + done + + nc_count=0; completed=false + until [ "${completed}" == "true" ]; do + for nodecmd in /tmp/.nodeskipcheck.*.done; do + if [[ "${nodecmd}" != *"*"* ]]; then + nodecmd_output=$(cat ${nodecmd}) + [ "${nodecmd_output}" != "" ] && echo -e "${nodecmd_output}" + rm -f ${nodecmd} + ((nc_count++)) + fi + done + if [ ${nc_count} -eq ${ncount} ]; then + completed=true + break + fi + sleep 2s + done + + echo -e "\n${idsCL[Default]}${idsST[Reset]}" +} + +GETSKIP(){ + nip="${1}" + NCMD="ssh -tq -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}" + NODE="${NM_HOSTNAMES[${nip}]} [${nip}]" + tmpfile=/tmp/.nodeskipcheck.${NM_HOSTNAMES[${nip}]// /-} + ${NCMD} [ -f ${NM_TMPFOLDER}/.skip ] && echo "SKIPPED" >> ${tmpfile}.running || echo "NOT Skipped" >> ${tmpfile}.running + [ -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