Update sonarr.sh

- major code refactoring
- breaking changes
https://github.com/tteck/Proxmox/discussions/1738#discussioncomment-8005107
This commit is contained in:
tteckster 2024-01-03 12:10:09 -05:00 committed by GitHub
parent f2c8792461
commit a3ef98e1f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 21 deletions

View File

@ -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? <y/N> " 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
}