This commit is contained in:
2023-04-21 15:47:43 -05:00
parent 7036995857
commit c933626e79
2 changed files with 107 additions and 80 deletions

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env bash
VERS='4.04202023'
VERS='4.04212023'
MMFOLDER="/opt/idssys/mediamanager"
MMSRV=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1)
UPDATESERVICES=radarr,lidarr,jackett,bazarr
BETA_SERVICES=" radarr "
UPDATESERVICES=radarr,lidarr,jackett,bazarr,ombi,sonarr
BETA_SERVICES=" "
IFS=,
UPDATE_SERVICES=(${UPDATESERVICES})
@@ -45,8 +45,10 @@ MM_SERVICE_PORTS['bazarr']='6767'
declare -A MM_UPDATE_REPO
#MM_UPDATE_REPO['ombi']='Ombi-app'
MM_UPDATE_REPO['ombi']='systemd'
MM_UPDATE_REPO['radarr']='radarr'
#MM_UPDATE_REPO['sonarr']='sonarr'
MM_UPDATE_REPO['sonarr']='systemd'
MM_UPDATE_REPO['lidarr']='lidarr'
MM_UPDATE_REPO['jackett']='jackett'
MM_UPDATE_REPO['bazarr']='morpheus65535'

View File

@@ -650,6 +650,8 @@ UPDATESERVICE(){
echo -e "${idsCL[Green]}Updating ${usrvc^} Service${idsCL[Default]}"
DIVIDER . lightGreen
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
@@ -668,6 +670,8 @@ UPDATESERVICE(){
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
if [ "${MM_UPDATE_REPO[${usrvc}]}" != "" ] && [ "${MM_UPDATE_REPO[${usrvc}]}" != "systemd" ]; then
msg="Finding latest update url"
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
@@ -716,6 +720,22 @@ UPDATESERVICE(){
rm -f ${tmpfile} &>/dev/null
elif [ "${MM_UPDATE_REPO[${usrvc}]}" == "systemd" ]; then
msg="Updating"
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 ${usrvc} >/dev/null 2>&1
/bin/systemctl disable ${usrvc} >/dev/null 2>&1
echo -e "${idsCL[Green]}Done${idsCL[Default]}"
fi
msg="Starting service back up"
c=0; spc=''; spc1=$((${cw_spc}-${#msg}))
until [ $c = ${spc1} ]; do spc="${spc} "; c=`expr $c + 1`; done
@@ -736,6 +756,11 @@ UPDATESERVICE(){
echo
echo -e "${idsCL[Green]}${usrvc} Service has been updated${idsCL[Default]}"
else
echo -e "${idsCL[Red]}Not currently available to update${idsCL[Default]}"
fi
else
echo -e "${idsCL[Red]}No service selected for update${idsCL[Default]}"
fi