Update mm-scripts.sh

This commit is contained in:
2023-07-09 13:09:21 -05:00
parent 9d7e1f33ef
commit 044b65c9e2

View File

@@ -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