This commit is contained in:
2023-05-02 18:22:37 -05:00
parent f0be95e5d5
commit e0994bc120
2 changed files with 15 additions and 21 deletions

View File

@@ -5,17 +5,13 @@ action="$1"
VERBOSE=true
if [ -f /opt/idssys/settings/mediamanager.conf ]; then
mv /opt/idssys/settings/mediamanager.conf ${MMFOLDER}/settings.conf
fi
source /opt/idssys/defaults/colors.inc
source /opt/idssys/defaults/default.inc
source /opt/idssys/mediamanager/settings.conf
source /opt/idssys/mediamanager/defaults.inc
[ -f ${MMFOLDER}/realwanip ] && source ${MMFOLDER}/realwanip
[ -f ${MMFOLDER}/vers.info ] && source ${MMFOLDER}/vers.info
[ "${GITBRANCH}" != "" ] && GBRANCH="${GITBRANCH}" || GBRANCH="master"
if [ "${2}" == "q" ]; then
unset idsCL idsBG idsST
@@ -59,8 +55,9 @@ MMCRONCHECK(){
echo "$(date) - Updated All Services" >> $logfile
fi
elif [ $(date +%H)$(date +%M) -ge 0300 ] && [ $(date +%H)$(date +%M) -lt 0305 ] ; then
if [ $(expr `date +%s` - $(stat -c %Y ${MMFOLDER}/.git/index)) -gt 600 ]; then
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
/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
fi
fi
@@ -848,11 +845,11 @@ UPDATESERVICE(){
echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}"
/bin/systemctl restart nginx >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
echo "$(date) - Updating Service (${usrvc}) : Completed" >> $logfile
else
echo -e " ${idsCL[LightCyan]} Update Not Needed ${idsCL[Default]}"
echo "$(date) - Updating Service (${usrvc}) : Update Not Needed" >> $logfile
fi
echo "$(date) - Updated Organizr" >> $logfile
else
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
@@ -954,7 +951,7 @@ UPDATESERVICE(){
else
echo -e "${idsCL[LightCyan]} Update Not Needed ${idsCL[Default]}"
echo "$(date) - Updating Service (${usrvc}) : Update Not Needed" >> $logfile
fi
elif [ "${MM_UPDATE_REPO[${usrvc}]}" == "systemd" ]; then
@@ -969,10 +966,11 @@ UPDATESERVICE(){
/usr/bin/apt install ${usrvc} >/dev/null 2>&1
/bin/systemctl disable ${usrvc} >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
echo "$(date) - Updating Service (${usrvc}) : Completed" >> $logfile
else
echo -e "${idsCL[LightCyan]}Update Not Needed${idsCL[Default]}"
echo "$(date) - Updating Service (${usrvc}) : Update not needed" >> $logfile
fi
fi