From df01a6bdc83a1904d72717ea6be00d20dbc4df64 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 2 Apr 2024 10:08:36 -0500 Subject: [PATCH] Update emulator-sync-scripts.sh --- emulator-sync-scripts.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/emulator-sync-scripts.sh b/emulator-sync-scripts.sh index a97a4a4..de9fcc1 100755 --- a/emulator-sync-scripts.sh +++ b/emulator-sync-scripts.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERS='1.1.10-022020024' +VERS='1.1.12-040220024' source /opt/idssys/defaults/colors.inc source /opt/idssys/defaults/default.inc @@ -41,12 +41,7 @@ RUNSYNC(){ # echo "Nextcloud sync failure, ${ES_LOGFOLDER}/failures2.txt exists." # SENDNOTICE "Nextcloud Sync Failure" "${ES_LOGFOLDER}/failures2.txt Exists\n\n$(date)" 1 - if [ -f "${NM_TMPFOLDER}/status-check.running" ] && [ $(expr `date +%s` - $(stat -c %Y ${NM_TMPFOLDER}/status-check.running)) -gt 1800 ]; then - /bin/rm -f ${ES_LOGFOLDER}/failures.txt - else - /bin/rm -f ${ES_FOLDER}/nc-sync.running - exit 1 - fi + [ $(expr `date +%s` - $(stat -c %Y ${ES_LOGFOLDER}/failures.txt)) -gt 1800 ] && /bin/rm -f ${ES_LOGFOLDER}/failures.txt else /bin/mv ${ES_LOGFOLDER}/failures.txt ${ES_LOGFOLDER}/failures2.txt fi @@ -75,14 +70,13 @@ RUNSYNC(){ else if [ -f ${ES_FOLDER}/mount.failure ]; then SENDNOTICE "Nextcloud Sync Unmounted" "The folder ${NC_PATH} Cannot be mounted" 1 - /bin/rm -f ${ES_FOLDER}/nc-sync.running - exit 1 + else /usr/bin/mount -a touch ${ES_FOLDER}/mount.failure - /bin/rm -f ${ES_FOLDER}/nc-sync.running - exit 1 fi + /bin/rm -f ${ES_FOLDER}/nc-sync.running + exit 1 fi else @@ -101,4 +95,5 @@ case ${1} in esac -exit 1 \ No newline at end of file +exit 1 +