diff options
-rw-r--r-- | mkosi.extra/etc/systemd/system/radarr.service | 3 | ||||
-rwxr-xr-x | mkosi.postinst | 33 |
2 files changed, 20 insertions, 16 deletions
diff --git a/mkosi.extra/etc/systemd/system/radarr.service b/mkosi.extra/etc/systemd/system/radarr.service index 892a829..20dfa0e 100644 --- a/mkosi.extra/etc/systemd/system/radarr.service +++ b/mkosi.extra/etc/systemd/system/radarr.service @@ -8,7 +8,8 @@ Group=warez Umask=022 Type=simple -ExecStart=/usr/bin/mono /opt/Radarr/Radarr.exe -nobrowser -data=/config +Environment=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true +ExecStart=/opt/Radarr/Radarr -nobrowser -data=/config TimeoutStopSec=20 KillMode=process Restart=on-failure diff --git a/mkosi.postinst b/mkosi.postinst index 0f1c802..a296e1e 100755 --- a/mkosi.postinst +++ b/mkosi.postinst @@ -1,4 +1,16 @@ #!/bin/sh + +# vars +githubrepo="Radarr/Radarr" +version=$(curl -s "https://api.github.com/repos/${githubrepo}/releases/latest" | grep 'tag_name' | sed -E 's/.*"([^"]+)".*/\1/') +filename="Radarr.master.$(echo ${version} | cut -c2-).linux-core-x64.tar.gz" +dlurl="https://github.com/${githubrepo}/releases/download/${version}/${filename}" + +user="warez" +home="/opt/Radarr" + + +# GO set -ex export DEBIAN_FRONTEND=noninteractive @@ -12,24 +24,15 @@ echo "deb http://no.archive.ubuntu.com/ubuntu $(lsb_release --short --codename)- echo "deb http://no.archive.ubuntu.com/ubuntu $(lsb_release --short --codename)-updates main universe" >> /etc/apt/sources.list apt-get update && apt-get --yes full-upgrade && apt-get --yes autoremove -# mono -#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -curl https://download.mono-project.com/repo/xamarin.gpg | apt-key add - -echo "deb https://download.mono-project.com/repo/ubuntu stable-$(lsb_release --short --codename) main" | tee /etc/apt/sources.list.d/mono-official-stable.list - -apt-get update - -apt-get install --yes mono-devel - # radarr -cd /opt -curl -L -O $( curl -s https://api.github.com/repos/Radarr/Radarr/releases | grep linux.tar.gz | grep browser_download_url | head -1 | cut -d \" -f 4 ) -tar -xvzf Radarr.*.linux.tar.gz -groupadd --system --gid 997 warez -useradd --system --gid warez --uid 997 --home-dir /opt/Radarr warez +groupadd --system --gid 997 "${user}" +useradd --system --gid "${user}" --uid 997 --home-dir "${home}" --create-home "${user}" + +curl --location --silent --output "/tmp/${filename}" "${dlurl}" +tar -xvz -C /opt -f "/tmp/${filename}" && rm "/tmp/${filename}" -chown -R warez: /opt/Radarr +chown -R "${user}": "${home}" # system service systemctl enable radarr.service |