From a3ef98e1f8cc45f6b42cdebadd0553d79fdd7eaa Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 3 Jan 2024 12:10:09 -0500 Subject: [PATCH] Update sonarr.sh - major code refactoring - breaking changes https://github.com/tteck/Proxmox/discussions/1738#discussioncomment-8005107 --- ct/sonarr.sh | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/ct/sonarr.sh b/ct/sonarr.sh index 89409d81..22af05ef 100644 --- a/ct/sonarr.sh +++ b/ct/sonarr.sh @@ -8,12 +8,12 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build function header_info { clear cat <<"EOF" - _____ + _____ / ___/____ ____ ____ __________ \__ \/ __ \/ __ \/ __ `/ ___/ ___/ - ___/ / /_/ / / / / /_/ / / / / -/____/\____/_/ /_/\__,_/_/ /_/ - + ___/ / /_/ / / / / /_/ / / / / +/____/\____/_/ /_/\__,_/_/ /_/ + EOF } header_info @@ -52,23 +52,16 @@ function default_settings() { function update_script() { header_info -if [[ ! -f /etc/apt/sources.list.d/sonarr.list ]]; then msg_error "No ${APP} Installation Found!"; exit; fi -read -r -p "Are you updating Sonarr v4? " prompt -if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - msg_info "Updating $APP v4" - systemctl stop sonarr.service - wget -q -O SonarrV4.tar.gz 'https://services.sonarr.tv/v1/download/develop/latest?version=4&os=linux' - tar -xzf SonarrV4.tar.gz - cp -r Sonarr/* /usr/lib/sonarr/bin - rm -rf Sonarr SonarrV4.tar.gz - systemctl start sonarr.service - msg_ok "Updated $APP v4" - exit -fi -msg_info "Updating $APP LXC" -apt-get update &>/dev/null -apt-get -y upgrade &>/dev/null -msg_ok "Updated $APP LXC" +if [[ ! -d /opt/Sonarr ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +msg_info "Updating $APP v4" +systemctl stop sonarr.service +wget -q -O SonarrV4.tar.gz 'https://services.sonarr.tv/v1/download/main/latest?version=4&os=linux&arch=x64' +tar -xzf SonarrV4.tar.gz +rm -rf /opt/Sonarr +mv Sonarr /opt +rm -rf SonarrV4.tar.gz +systemctl start sonarr.service +msg_ok "Updated $APP v4" exit }