diff --git a/defaults.inc b/defaults.inc index 3077ae3..d1cf30f 100755 --- a/defaults.inc +++ b/defaults.inc @@ -5,7 +5,7 @@ VERS='3.8.148-04232023' MMFOLDER="/opt/idssys/mediamanager" MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) -UPDATESERVICES=bazarr,jackett,lidarr,ombi,radarr,sonarr +UPDATESERVICES=bazarr,jackett,lidarr,ombi,organizr,radarr,sonarr BETA_SERVICES=" " IFS=, diff --git a/mm-scripts.sh b/mm-scripts.sh index 3ffe180..c6ac23d 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -818,16 +818,21 @@ UPDATESERVICE(){ msg="Updating Organizr"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" cd /var/www/media.scity.us/html >/dev/null 2>&1 - /usr/bin/git stash >/dev/null 2>&1 - /usr/bin/git pull >/dev/null 2>&1 - /bin/chown -Rf www-data:www-data /var/www/media.scity.us/html - echo -e "${idsCL[Green]}Done${idsCL[Default]}" - - msg="Restarting NGINX"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done - echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" - /bin/systemctl restart nginx >/dev/null 2>&1 - echo -e "${idsCL[Green]}Done${idsCL[Default]}" + if [ "`git log --pretty=%H ...refs/heads/v2-master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/v2-master |cut -f1`" ]; then + /usr/bin/git stash >/dev/null 2>&1 + /usr/bin/git pull >/dev/null 2>&1 + /bin/chown -Rf www-data:www-data /var/www/media.scity.us/html + echo -e "${idsCL[Green]}Updated${idsCL[Default]}" + + msg="Restarting NGINX"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done + echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" + /bin/systemctl restart nginx >/dev/null 2>&1 + echo -e "${idsCL[Green]}Done${idsCL[Default]}" + else + echo -e "${idsCL[LightCyan]}Update not needed${idsCL[Default]}" + fi + echo "$(date) - Updated Organizr" >> $logfile else