This commit is contained in:
2024-11-29 19:22:57 -06:00
parent e85b69c8af
commit b36b243804
2 changed files with 21 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERS='5.3.13-11292024'
VERS='5.3.14-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 '

View File

@@ -414,26 +414,23 @@ NODEUPDATE(){
if [ "${nip}" != "100.100.2.1" ] && [ "${nip}" != "${NM_OFFSITE_GW_IP}" ] && [ ! -f ${NM_TMPFOLDER}/${nip}.down ] && [ "$(CHECK_HOST ${nip})" != "false" ]; then
if [ "${betacheck}" == "false" ]; then
if [ "${2}" != "sync" ]; then
echo "" >> ${tmpfile}.running
# # [ ${noup} -eq 0 ] && echo -en " ~ ${idsCL[LightCyan]}NodeMGMT${idsCL[Default]} : " >> ${tmpfile}.running
# if [ "$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1)" != "ok" ]; then
# echo -e "${idsCL[Yellow]}[${nip}] New server, needs SSH credentials${idsCL[Default]}"
# ssh-copy-id root@${nip}
# fi
# if ! ${NCMD} command -v nodemgmt > /dev/null; then
# ${NCMD} "bash <(curl -sL https://go.scity.us/install-nodemgmt)" >/dev/null 2>&1
# ${NMCMD} rsync -az ${NM_FOLDER}/conf/*.inc ${NM_FOLDER}/conf/*.conf root@${nip}:${NM_FOLDER}/conf/ >/dev/null 2>&1
# ${NMCMD} rsync -az ${NM_FOLDER}/conf/powerwall ${NM_FOLDER}/conf/*.conf root@${nip}:${NM_FOLDER}/conf/ >/dev/null 2>&1
# sleep 2s
# [ "${NM_GITPASS}" != "" ] && [ "${NM_GITUSER^^}" == "VOLTRON" ] && ${NMCMD} "bash <(curl -sL https://go.scity.us/add-linux-pass)" >/dev/null 2>&1
# echo -e "${idsCL[Green]}Installed & Synced${idsCL[Default]}" >> ${tmpfile}.running
# elif [ ${noup} -eq 1 ]; then
# echo -e "${idsCL[Green]}Already Installed${idsCL[Default]}" >> ${tmpfile}.running
# else
# ${NCMD} "nodemgmt update q" >> ${tmpfile}.running
# fi
if [ "$(ssh -o BatchMode=yes -o ConnectTimeout=3 root@${nip} echo ok 2>&1)" != "ok" ]; then
echo -e "${idsCL[Yellow]}[${nip}] New server, needs SSH credentials${idsCL[Default]}"
ssh-copy-id root@${nip}
fi
if ! ${NCMD} command -v nodemgmt > /dev/null; then
${NCMD} "bash <(curl -sL https://go.scity.us/install-nodemgmt)" >/dev/null 2>&1
${NMCMD} rsync -az ${NM_FOLDER}/conf/*.inc ${NM_FOLDER}/conf/*.conf root@${nip}:${NM_FOLDER}/conf/ >/dev/null 2>&1
${NMCMD} rsync -az ${NM_FOLDER}/conf/powerwall ${NM_FOLDER}/conf/*.conf root@${nip}:${NM_FOLDER}/conf/ >/dev/null 2>&1
sleep 2s
[ "${NM_GITPASS}" != "" ] && [ "${NM_GITUSER^^}" == "VOLTRON" ] && ${NMCMD} "bash <(curl -sL https://go.scity.us/add-linux-pass)" >/dev/null 2>&1
echo -e "${idsCL[Green]}Installed & Synced${idsCL[Default]}" >> ${tmpfile}.running
elif [ ${noup} -eq 1 ]; then
echo -e "${idsCL[Green]}Already Installed${idsCL[Default]}" >> ${tmpfile}.running
else
${NCMD} "nodemgmt update q" >> ${tmpfile}.running
fi
else
# echo -en " ~ ${idsCL[LightCyan]}Sync Shared Nodemgmt Defaults${idsCL[Default]} : " >> ${tmpfile}.running
${NMCMD} rsync -az ${NM_FOLDER}/conf/*.inc ${NM_FOLDER}/conf/*.conf root@${nip}:${NM_FOLDER}/conf/ & >/dev/null 2>&1
${NMCMD} rsync -az ${NM_FOLDER}/conf/powerwall ${NM_FOLDER}/conf/*.conf root@${nip}:${NM_FOLDER}/conf/ >/dev/null 2>&1
echo -e "${idsCL[Green]}Files Synced${idsCL[Default]}" >> ${tmpfile}.running
@@ -441,10 +438,10 @@ NODEUPDATE(){
else
echo -e "${idsCL[LightCyan]}Skipping BETA Update${idsCL[Default]}" >> ${tmpfile}.running
fi
# elif [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
# echo -e "${idsCL[LightCyan]}Skipping, host is offline${idsCL[Default]}" >> ${tmpfile}.running
# else
# echo -e "${idsCL[LightCyan]}Skipping${idsCL[Default]}" >> ${tmpfile}.running
elif [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
echo -e "${idsCL[LightCyan]}Skipping, host is offline${idsCL[Default]}" >> ${tmpfile}.running
else
echo -e "${idsCL[LightCyan]}Skipping${idsCL[Default]}" >> ${tmpfile}.running
fi
[ -f ${tmpfile}.running ] && mv ${tmpfile}.running ${tmpfile}.done || touch ${tmpfile}.done