diff --git a/mm-scripts.sh b/mm-scripts.sh index e892097..3367e69 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -1014,13 +1014,16 @@ WantedBy=multi-user.target echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" [ "${usrvc}" == "qbittorrent" ] && ausrvc="qbittorrent-nox" || ausrvc=${usrvc} - if [ "$(apt-get -s upgrade | grep ${ausrvc})" != "" ] || [ "${2}" == "-f" ]; then - echo -e "${idsCL[Green]}Update Available${idsCL[Default]}" + if [ "$(apt-get -s upgrade | grep ${ausrvc})" != "" ] || [ "${3}" == "-f" ]; then + [ "${3}" == "-f" ] && [ "$(apt-get -s upgrade | grep ${ausrvc})" == "" ] && echo -e "${idsCL[Green]}Update not needed, forcing anyway${idsCL[Default]}" || echo -e "${idsCL[Green]}Update Available${idsCL[Default]}" SERVICEBACKUP ${usrvc} 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/apt install ${ausrvc} -y >/dev/null 2>&1 + + [ "${3}" == "-f" ] && [ "$(apt-get -s upgrade | grep ${ausrvc})" == "" ] && /usr/bin/apt install --reinstall ${ausrvc} -y >/dev/null 2>&1 || /usr/bin/apt install ${ausrvc} -y >/dev/null 2>&1 + systemctl disable ${ausrvc} >/dev/null 2>&1 + echo -e "${idsCL[Green]}Done${idsCL[Default]}" echo "$(date) - Updating Service (${usrvc}) : Completed" >> $logfile