#!/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 # motd chmod 644 /etc/update-motd.d/* systemctl mask motd-news.service systemctl mask motd-news.timer # Add update- and security-repositories, and perform upgrade echo "deb http://no.archive.ubuntu.com/ubuntu $(lsb_release --short --codename)-security main universe" >> /etc/apt/sources.list 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 # radarr 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 "${user}": "${home}" # system service systemctl enable radarr.service