From 6676c4f215f0e0bdb9e6fa7896dae34c6982d21c Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 30 Jun 2023 19:24:03 -0500 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index 8a7ee3a..c76b45a 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -45,29 +45,36 @@ MMCRONCHECK(){ [ ${#OUT} = 0 ] && /bin/ip route add default via ${DEFAULT_GW} fi - if [ -f ${TMPFOLDER}/mm.stop ]; then - /usr/local/bin/mm check q >/dev/null 2>&1 - else - echo -e "$(date) - Starting log #############################" >> ${outputlogfile} - /usr/local/bin/mm check q >> ${outputlogfile} - echo -e "$(date) - Finished log #############################" >> ${outputlogfile} - fi - - - if [ $(date +%u) -eq 4 ] && [ $(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 - /usr/local/bin/mm update-allservices q >/dev/null 2>&1 + echo "updating services executing" + # /usr/local/bin/mm update-allservices q >/dev/null 2>&1 echo "$(date) - Updated All Services" >> $logfile + else + echo "not updating" fi elif [ $(date +%H)$(date +%u) -eq 3 ] && [ $(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 source /opt/idssys/mediamanager/defaults.inc echo "$(date) - Updated MM Scripts to v${VERS}" >> $logfile + else + echo "not updating" fi + else + echo "no scheduled tasks" fi + # if [ -f ${TMPFOLDER}/mm.stop ]; then + # /usr/local/bin/mm check q >/dev/null 2>&1 + # else + # echo -e "$(date) - Starting log #############################" >> ${outputlogfile} + # /usr/local/bin/mm check q >> ${outputlogfile} + # echo -e "$(date) - Finished log #############################" >> ${outputlogfile} + # fi exit 0 }