Update mm-scripts.sh
This commit is contained in:
@@ -837,25 +837,6 @@ UPDATESERVICE(){
|
|||||||
|
|
||||||
else
|
else
|
||||||
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
|
if [[ " ${UPDATE_SERVICES[*]} " =~ " ${usrvc} " ]]; then
|
||||||
|
|
||||||
msg="Stopping service and preparing"; 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]}"
|
|
||||||
|
|
||||||
rm -f ${MMFOLDER}/logs/update.${usrvc}
|
|
||||||
touch ${MMFOLDER}/logs/update.${usrvc}
|
|
||||||
|
|
||||||
/bin/systemctl stop ${usrvc} >> ${MMFOLDER}/logs/update.${usrvc}
|
|
||||||
[ "${usrvc}" == "radarr" ] && [[ " ${SERVICES_CHECK[*]} " =~ " radarr3d " ]] && /bin/systemctl stop radarr3d >> ${MMFOLDER}/logs/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
|
|
||||||
[ ! -d /opt/Backups ] && mkdir /opt/Backups
|
|
||||||
|
|
||||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
|
||||||
|
|
||||||
if [ "${MM_UPDATE_REPO[${usrvc}]}" != "" ] && [ "${MM_UPDATE_REPO[${usrvc}]}" != "systemd" ]; then
|
if [ "${MM_UPDATE_REPO[${usrvc}]}" != "" ] && [ "${MM_UPDATE_REPO[${usrvc}]}" != "systemd" ]; then
|
||||||
|
|
||||||
msg="Finding latest update url"
|
msg="Finding latest update url"
|
||||||
@@ -883,6 +864,23 @@ UPDATESERVICE(){
|
|||||||
echo -e "${idsCL[White]}${msg}${spc} : ${idsCL[Green]}${!cver}${idsCL[Default]}"
|
echo -e "${idsCL[White]}${msg}${spc} : ${idsCL[Green]}${!cver}${idsCL[Default]}"
|
||||||
|
|
||||||
if [ "${!cver}" != "${installed_ver}" ]; then
|
if [ "${!cver}" != "${installed_ver}" ]; then
|
||||||
|
tmpfile=/tmp/${usrvc}-update.tar.gz
|
||||||
|
bak=/opt/Backups/${usrvc}.opt.tgz
|
||||||
|
bakcfg=/opt/Backups/${usrvc}.cfg.tgz
|
||||||
|
|
||||||
|
msg="Stopping service and preparing"; 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]}"
|
||||||
|
|
||||||
|
rm -f ${MMFOLDER}/logs/update.${usrvc}
|
||||||
|
touch ${MMFOLDER}/logs/update.${usrvc}
|
||||||
|
|
||||||
|
/bin/systemctl stop ${usrvc} >> ${MMFOLDER}/logs/update.${usrvc}
|
||||||
|
[ "${usrvc}" == "radarr" ] && [[ " ${SERVICES_CHECK[*]} " =~ " radarr3d " ]] && /bin/systemctl stop radarr3d >> ${MMFOLDER}/logs/update.${usrvc}
|
||||||
|
|
||||||
|
[[ -f ${bak} ]] && rm -f "${bak}" &>/dev/null
|
||||||
|
[[ -f ${tmpfile} ]] && rm -f "${tmpfile}" &>/dev/null
|
||||||
|
[ ! -d /opt/Backups ] && mkdir /opt/Backups
|
||||||
|
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||||
|
|
||||||
msg="Downloading and updating"
|
msg="Downloading and updating"
|
||||||
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
|
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
|
||||||
|
|||||||
Reference in New Issue
Block a user