Update mm-scripts.sh

This commit is contained in:
2023-06-30 20:52:41 -05:00
parent f08a173ee4
commit b57de4218d

View File

@@ -46,13 +46,11 @@ MMCRONCHECK(){
fi
if [ $(date +%u) -eq 6 ] && [ $(date +%H)$(date +%M) -ge 0400 ] && [ $(date +%H)$(date +%M) -le 0405 ] ; then
echo "update services crontask triggered"
if [ $(expr `date +%s` - $(stat -c %Y ${TMPFOLDER}/vers.info)) -gt 600 ]; then
UPDATESERVICE service all q >/dev/null 2>&1
echo "$(date) - Updated All Services" >> $logfile
fi
elif [ $(date +%H)$(date +%u) -eq 6 ] && [ $(date +%H)$(date +%M) -ge 0300 ] && [ $(date +%H)$(date +%M) -lt 0305 ] ; then
echo "update mm crontask triggered"
if [ $(expr `date +%s` - $(stat -c %Y ${MMFOLDER}/.git/ORIG_HEAD)) -gt 600 ] && [ "`git -C /opt/idssys/nodemgmt log --pretty=%H ...refs/heads/${GBRANCH}^ | head -n 1`" != "`git -C /opt/idssys/nodemgmt ls-remote origin -h refs/heads/${GBRANCH} |cut -f1`" ]; then
echo "updating mm executing"
/usr/local/bin/mm update q >/dev/null 2>&1