Update emulator-sync-scripts.sh

This commit is contained in:
2024-04-02 10:08:36 -05:00
parent 6ffdf6a187
commit df01a6bdc8

View File

@@ -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,15 +70,14 @@ 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
fi
/bin/rm -f ${ES_FOLDER}/nc-sync.running
exit 1
fi
fi
else
echo "There is a sync in process"
@@ -102,3 +96,4 @@ esac
exit 1