update
This commit is contained in:
19
defaults.inc
19
defaults.inc
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERS='3.9.24-07092023'
|
||||
VERS='3.9.25-07092023'
|
||||
|
||||
MMFOLDER="/opt/idssys/mediamanager"
|
||||
TMPFOLDER="${MMFOLDER}/.tmp"
|
||||
@@ -13,7 +13,13 @@ AVAILSERVICES=bazarr,jackett,lidarr,ombi,snap.overseerr.daemon,prowlarr,qbittorr
|
||||
UPDATESERVICES=bazarr,jackett,lidarr,ombi,organizr,prowlarr,qbittorrent,radarr,readarr,sonarr
|
||||
BETA_SERVICES=" readarr "
|
||||
|
||||
NM_BACKUP_FOLDER='/opt/!MM-Service-Backups'
|
||||
MM_LOGFILE=${LOGFOLDER}/logfile
|
||||
MM_OUTPUT_LOGFILE=${LOGFOLDER}/outputs.check.log
|
||||
MM_BACKUP_FOLDER='/opt/!MM-Service-Backups'
|
||||
|
||||
[ ! -f ${MM_LOGFILE} ] && touch ${MM_LOGFILE}
|
||||
[ ! -f ${MM_OUTPUT_LOGFILE} ] && touch ${MM_OUTPUT_LOGFILE}
|
||||
[ ! -d ${MM_BACKUP_FOLDER} ] && mkdir ${MM_BACKUP_FOLDER}
|
||||
|
||||
IFS=,
|
||||
AVAIL_SERVICES=(${AVAILSERVICES})
|
||||
@@ -24,11 +30,8 @@ unset IFS
|
||||
noheader=' check noup update update-organizr cron '
|
||||
allowrun=' status update stop vpninfo '
|
||||
|
||||
logfile=${LOGFOLDER}/logfile
|
||||
outputlogfile=${LOGFOLDER}/outputs.check.log
|
||||
[ ! -f ${logfile} ] && touch $logfile
|
||||
[ ! -f ${outputlogfile} ] && touch $outputlogfile
|
||||
[ ! -d /opt/Backups ] && mkdir /opt/Backups
|
||||
|
||||
|
||||
|
||||
declare -A MM_SERVICES
|
||||
MM_SERVICES['openvpn']='OpenVPN (TorGuard VPN Tunnel)'
|
||||
@@ -117,7 +120,7 @@ fi
|
||||
DEBUGLOGSTOP(){
|
||||
chktmend=`date +%s`
|
||||
chktm=$((chktmend-chktmstart))
|
||||
echo "$(date) - ${mmsv} Runtime: ${chktm}s" >> $logfile
|
||||
echo "$(date) - ${mmsv} Runtime: ${chktm}s" >> ${MM_LOGFILE}
|
||||
}
|
||||
|
||||
MMUPDATECHECK(){
|
||||
|
||||
@@ -1103,7 +1103,7 @@ SERVICEBACKUP(){
|
||||
|
||||
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=${NM_BACKUP_FOLDER}/${usrvc}
|
||||
BACKUPDIR=${MM_BACKUP_FOLDER}/${usrvc}
|
||||
[ ! -d ${BACKUPDIR} ] && mkdir -p ${BACKUPDIR}
|
||||
[ "${usrvc}" == "radarr" ] && [ ! -d ${BACKUPDIR}3d ] && mkdir -p ${BACKUPDIR}3d
|
||||
[ "${MM_SERVICE_APP[$usrvc]}" != "" ] && APPBAKFOLDER=${MM_SERVICE_APP[$usrvc]} || APPBAKFOLDER=/opt/${usrvc^}
|
||||
@@ -1145,20 +1145,7 @@ SERVICEBACKUP(){
|
||||
fi
|
||||
fi
|
||||
}
|
||||
SERVICEBACKUP.old(){
|
||||
usrvc=${1}
|
||||
msg="Stopping Service and Backing Up"; 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}
|
||||
bak=/opt/Backups/${usrvc}.opt.tgz
|
||||
bakcfg=/opt/Backups/${usrvc}.cfg.tgz
|
||||
[[ -f ${bak} ]] && rm -f "${bak}" &>/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}
|
||||
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
|
||||
}
|
||||
|
||||
SERVICEBACKUPSTART(){
|
||||
msg="Starting 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]}"
|
||||
|
||||
Reference in New Issue
Block a user