diff --git a/mm-scripts.sh b/mm-scripts.sh index 7017650..0c19690 100755 --- a/mm-scripts.sh +++ b/mm-scripts.sh @@ -948,6 +948,8 @@ UPDATESERVICE(){ echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" if curl --output /dev/null --silent --head --fail $latest_release_url; then + tmpfile=/tmp/${usrvc}-update.tar.gz + [[ -f ${tmpfile} ]] && rm -f "${tmpfile}" &>/dev/null wget -qO ${tmpfile} $latest_release_url >> ${LOGFOLDER}/update.${usrvc} if [[ ( $? -eq 0 ) && ( -f ${tmpfile} ) ]]; then if [ "${usrvc}" != "bazarr" ]; then @@ -1041,11 +1043,9 @@ SERVICEBACKUP(){ echo -en "${idsCL[White]}${msg}${spc} : ${idsCL[Default]}" /bin/systemctl stop ${usrvc} >> ${LOGFOLDER}/update.${usrvc} [ "${usrvc}" == "radarr" ] && /bin/systemctl stop radarr3d >> ${LOGFOLDER}/update.${usrvc} - tmpfile=/tmp/${usrvc}-update.tar.gz bak=/opt/Backups/${usrvc}.opt.tgz bakcfg=/opt/Backups/${usrvc}.cfg.tgz [[ -f ${bak} ]] && rm -f "${bak}" &>/dev/null - [[ -f ${tmpfile} ]] && rm -f "${tmpfile}" &>/dev/null [ "${MM_SERVICE_APP[$usrvc]}" != "" ] && bkfldr=${MM_SERVICE_APP[$usrvc]} || bkfldr=/opt/${usrvc^} [ "${MM_SERVICE_APP[$usrvc]}" != "none" ] && /bin/tar -cpPf $bak ${bkfldr} >> ${LOGFOLDER}/update.${usrvc} [ "${MM_SERVICE_CFG[${usrvc}]}" != "" ] && [ -d ${MM_SERVICE_CFG[${usrvc}]} ] && /bin/tar -cpPf $bakcfg ${MM_SERVICE_CFG[${usrvc}]} >> ${LOGFOLDER}/update.${usrvc}