Update mm-scripts.sh

This commit is contained in:
2023-07-09 16:52:41 -05:00
parent 9476e94d27
commit 9a4ce17f42

View File

@@ -1081,15 +1081,26 @@ SERVICEBACKUP(){
if [ "${usrvc}" == "all" ]; then
for uasrvc in "${UPDATE_SERVICES[@]}"; do
[ "${MM_UPDATE_REPO[${uasrvc}]}" != "" ] && [[ " ${SERVICES_CHECK[*]} " =~ " ${uasrvc} " ]] && SERVICEBACKUP ${uasrvc} ${2}
if [ "${MM_UPDATE_REPO[${uasrvc}]}" != "" ] && [[ " ${SERVICES_CHECK[*]} " =~ " ${uasrvc} " ]]; then
echo -e "${idsCL[Green]}Backing up ${usrvc^} Service${idsCL[Default]}"
DIVIDER . lightGreen
SERVICEBACKUP ${uasrvc} ${2}
SERVICEBACKUPSTART ${usrvc}
echo
fi
done
elif [ "${usrvc}" != "" ]; then
msg="Stopping Service and Backing Up"; c=0; spc=''; spc1=$((${cw_spc}-${#msg})); until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
msg="Stopping 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]}"
/bin/systemctl stop ${usrvc} >> ${LOGFOLDER}/update.${usrvc}
[ "${usrvc}" == "radarr" ] && /bin/systemctl stop radarr3d >> ${LOGFOLDER}/update.${usrvc}
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
msg="Backing Up 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]}"
BACKUPDIR=/opt/Backups/${usrvc}
[ ! -d ${BACKUPDIR} ] && mkdir -p ${BACKUPDIR}
[ "${MM_SERVICE_APP[$usrvc]}" != "" ] && APPBAKFOLDER=${MM_SERVICE_APP[$usrvc]} || APPBAKFOLDER=/opt/${usrvc^}