This commit is contained in:
2025-03-10 21:32:57 -05:00
parent 5acf9e6c78
commit 6307553ba8
3 changed files with 35 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='5.4.1b-03102025' VERS='5.4.2-03102025'
NM_BETA=false 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 ' 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

@@ -909,12 +909,43 @@ REPLSTART(){
${PH_CMD} rm -f ${NM_FOLDER}/.test.${STATUS_START//-/}.repl ${PH_CMD} rm -f ${NM_FOLDER}/.test.${STATUS_START//-/}.repl
daterun=`date +%Y-%m-%d-%H-%M-%S` daterun=`date +%Y-%m-%d-%H-%M-%S`
${PH_CMD} "echo -e \"Replcation-Test\n${daterun}\" > ${NM_REPL_CHECK_LOC[${rcheck}]}/.test.${STATUS_START//-/}.repl" & ${PH_CMD} "echo -e \"Replcation-Test\n${daterun}\" > ${NM_REPL_CHECK_LOC[${rcheck}]}/.test.${STATUS_START//-/}.repl" &
${PH_CMD} 'find ${NM_REPL_CHECK_LOC[${rcheck}]} -iname "*.sync-conflict-*" -exec rm {} \;' & ${PH_CMD} 'find '${NM_REPL_CHECK_LOC[${rcheck}]}' -iname "*.sync-conflict-*" -exec rm {} \;' &
done done
fi fi
fi fi
} }
REMOVE_CONFLICT_SYNC_FILES(){
echo
if [ "${1}" != "" ] && [ "${NM_NODETYPES[${1^^}]}" != "" ]; then
ntss=${1^^}
ntypesel=(${ntss})
else
ntss=""
ntypesel=(${NM_NODE_TYPES[@]})
fi
for NTYPE in "${ntypesel[@]}"; do
var=${NTYPE}_REPL_CHECK[@]
if [ ! -z ${!var+x} ]; then
var=${NTYPE}_HOSTS[@]
for nip in "${!var}"; do
if [ ! -f ${NM_TMPFOLDER}/${nip}.down ]; then
echo -e "${idsCL[LightYellow]}Removing all Syncthing 'sync-conflict' files from ${idsCL[LightGreen]}${NM_HOSTNAME[${nip}]}${idsCL[LightYellow]} [${nip}]${idsCL[Default]}"
PH_CMD="ssh -q -o ConnectTimeout=3 -o ConnectionAttempts=1 root@${nip}"
var2=${NTYPE}_REPL_CHECK[@]
for rcheck in "${!var2}"; do
echo -en "${idsCL[LightCyan]}Removing files from ${idsCL[Green]}${NM_REPL_CHECK_LOC[${rcheck}]}${idsCL[LightCyan]}${idsCL[Default]} ... "
${PH_CMD} 'find '${NM_REPL_CHECK_LOC[${rcheck}]}' -iname "*.sync-conflict-*" -exec rm {} \;' >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
done
fi
echo
done
fi
done
echo
}
STATUS_SCANTIMES(){ STATUS_SCANTIMES(){
start=$(date +%s) start=$(date +%s)
scandefault=1440 scandefault=1440

View File

@@ -1502,6 +1502,8 @@ GUI(){
skip) SKIP_SERVER_CHECKS ${2};; skip) SKIP_SERVER_CHECKS ${2};;
get-skips) LIST_SKIPPED_SERVERS;; get-skips) LIST_SKIPPED_SERVERS;;
sync-clean) REMOVE_CONFLICT_SYNC_FILES ${2};;
nginxupdate) nginxupdate)
echo echo
for nfile in ${NM_NGINXPATH}/sites-enabled/*.conf; do for nfile in ${NM_NGINXPATH}/sites-enabled/*.conf; do