Skip to content

Commit

Permalink
v9.9
Browse files Browse the repository at this point in the history
- DietPi-Software | Move to Sonarr v4
  • Loading branch information
MichaIng committed Dec 12, 2024
1 parent af587d4 commit d957919
Showing 1 changed file with 45 additions and 14 deletions.
59 changes: 45 additions & 14 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -9488,23 +9488,54 @@ _EOF_

if To_Install 144 sonarr # Sonarr
then
# https://sonarr.tv/#downloads-v3-linux-debian
# APT key
G_EXEC eval 'curl -sSf '\''https://keyserver.ubuntu.com/pks/lookup?search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8&op=get'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg --yes'
# Sonarr v4 does not support ARMv6
if (( $G_HW_ARCH == 1 ))
then
# https://sonarr.tv/#downloads-v3-linux-debian
# APT key
G_EXEC eval 'curl -sSf '\''https://keyserver.ubuntu.com/pks/lookup?search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8&op=get'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg --yes'

# APT list: Buster is the latest available suite: https://apt.sonarr.tv/debian/dists/
G_EXEC eval 'echo '\''deb https://apt.sonarr.tv/debian buster main'\'' > /etc/apt/sources.list.d/sonarr.list'
# APT list: Buster is the latest available suite: https://apt.sonarr.tv/debian/dists/
G_EXEC eval 'echo '\''deb https://apt.sonarr.tv/debian buster main'\'' > /etc/apt/sources.list.d/sonarr.list'

# Update package lists
G_AGUP
# Update package lists
G_AGUP

# Pre-configure DEB package
G_EXEC eval "debconf-set-selections <<< 'sonarr sonarr/owning_group string dietpi'"
G_EXEC eval "debconf-set-selections <<< 'sonarr sonarr/config_directory string /mnt/dietpi_userdata/sonarr'"

# Install Sonarr and mediainfo
G_AGI sonarr mediainfo
G_EXEC systemctl stop sonarr
else
# Pre-v9.9 cleanup
[[ -f '/etc/apt/sources.list.d/sonarr.list' ]] && G_EXEC rm /etc/apt/sources.list.d/sonarr.list
[[ -f '/etc/apt/trusted.gpg.d/dietpi-sonarr.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg
dpkg-query -s 'sonarr' &> /dev/null && G_AGP sonarr

# APT dependencies
aDEPS=('mediainfo')
# - .NET: https://github.com/dotnet/docs/blob/main/docs/core/install/linux-debian.md#dependencies
case $G_DISTRO in
6) aDEPS+=('libicu67');;
*) aDEPS+=('libicu72');;
esac

# Download
case $G_HW_ARCH in
2) local arch='arm';;
3) local arch='arm64';;
*) local arch='x64';;
esac

# Pre-configure DEB package
G_EXEC eval "debconf-set-selections <<< 'sonarr sonarr/owning_group string dietpi'"
G_EXEC eval "debconf-set-selections <<< 'sonarr sonarr/config_directory string /mnt/dietpi_userdata/sonarr'"
local fallback_url="https://github.com/Sonarr/Sonarr/releases/download/v4.0.11.2680/Sonarr.main.4.0.11.2680.linux-$arch.tar.gz"
Download_Install "$(curl -sSfL 'https://api.github.com/repos/Sonarr/Sonarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-$arch\.tar\.gz\"$/{print \$4}")"

# Install Sonarr and mediainfo
G_AGI sonarr mediainfo
G_EXEC systemctl stop sonarr
# Install: Remove previous instance on reinstall
[[ -d '/opt/sonarr' ]] && G_EXEC rm -R /opt/sonarr
G_EXEC mv Sonarr /opt/sonarr
fi

# Pre-v7.1: Remove Sonarr v2 key, PID file and database backups from DietPi-Arr_to_RAM
if [[ -f '/etc/apt/trusted.gpg' && $(apt-key --keyring /etc/apt/trusted.gpg list 'A236C58F409091A18ACA53CBEBFF6B99D9B78493' 2> /dev/null) ]]
Expand Down Expand Up @@ -12883,7 +12914,7 @@ _EOF_
Remove_Service sonarr 1 1 # group for pre-v6.29
G_AGP sonarr nzbdrone # Pre-v7.1
[[ -d '/var/log/sonarr' ]] && G_EXEC rm -R /var/log/sonarr
G_EXEC rm -Rf /mnt/dietpi_userdata/sonarr /opt/NzbDrone # Pre-v7.1
G_EXEC rm -Rf /opt/sonarr /mnt/dietpi_userdata/sonarr /opt/NzbDrone # Pre-v7.1
[[ -f '/etc/apt/sources.list.d/sonarr.list' ]] && G_EXEC rm /etc/apt/sources.list.d/sonarr.list
[[ -f '/etc/apt/trusted.gpg.d/dietpi-sonarr.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg
# Pre-v7.1: Remove Sonarr v2 key
Expand Down

0 comments on commit d957919

Please sign in to comment.