From bdf03daeabd630941805c7b1adc4bf981f97e885 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 7 May 2023 10:25:21 -0500 Subject: [PATCH] Update mm-scripts.sh --- mm-scripts.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm-scripts.sh b/mm-scripts.sh index cac7491..66c6a09 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -839,8 +839,8 @@ UPDATESERVICE(){ echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" cd /var/www/media.scity.us/html >/dev/null 2>&1 - if [ "`git log --pretty=%H ...refs/heads/v2-master^ | head -n 1`" != "`git ls-remote origin -h refs/heads/v2-master |cut -f1`" ] || [ "${2}" == "force" ]; then - [ "${2}" == "force" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${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`" ] || [ "${2}" == "-f" ]; then + [ "${2}" == "-f" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}" msg="Updating service"; 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]}" /usr/bin/git stash >/dev/null 2>&1 @@ -877,8 +877,8 @@ UPDATESERVICE(){ latest_ver=`echo ${latest_release_url} | cut -d/ -f8` cver=${usrvc}_VER - if [ "${!cver}" != "${latest_ver}" ] || [ "${2}" == "force" ]; then - [ "${2}" == "force" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}" + if [ "${!cver}" != "${latest_ver}" ] || [ "${2}" == "-f" ]; then + [ "${2}" == "-f" ] && echo -e "${idsCL[LightCyan]}Update Not Needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}" # rm -f ${MMFOLDER}/logs/update.${usrvc} touch ${MMFOLDER}/logs/update.${usrvc} @@ -930,7 +930,7 @@ UPDATESERVICE(){ echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" [ "${usrvc}" == "qbittorrent" ] && ausrvc="qbittorrent-nox" || ausrvc=${usrvc} - if [ "$(apt-get -s upgrade | grep ${ausrvc})" != "" ] || [ "${2}" == "force" ]; then + if [ "$(apt-get -s upgrade | grep ${ausrvc})" != "" ] || [ "${2}" == "-f" ]; then echo -e "${idsCL[Green]}Update Available${idsCL[Default]}" SERVICEBACKUP ${usrvc} @@ -1375,8 +1375,8 @@ USAGE(){ echo -e " ${idsCL[Yellow]}vpninfo ${idsCL[Default]}--> Show VPN Info" echo -e " ${idsCL[Yellow]}speedtest ${idsCL[Default]}--> Run Speedtest Comparison (with and w/o VPN)" echo - echo -e " ${idsCL[Yellow]}update-allservices ${idsCL[Default]}--> Update all services" - echo -e " ${idsCL[Yellow]}update-service ${idsCL[Default]}--> Update specified service" + echo -e " ${idsCL[Yellow]}update-allservices ${idsCL[Default]}--> Update all services ( -f = force update)" + echo -e " ${idsCL[Yellow]}update-service ${idsCL[Default]}--> Update specified service ( -f = force update)" echo -e " ${idsCL[Yellow]}update-list ${idsCL[Default]}--> List available releases" echo echo -e " ${idsCL[Yellow]}cron ${idsCL[Default]}--> Crontab job for maintaining system (run */1 min)"