Refactor: Radarr (#7088)

* Refactor

* Update radarr.sh
This commit is contained in:
Slaviša Arežina 2025-08-23 10:25:28 +02:00 committed by GitHub
parent 52a9ad733d
commit e7ccf9a512
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 23 deletions

View File

@ -29,19 +29,16 @@ function update_script() {
exit
fi
msg_info "Updating $APP LXC"
temp_file="$(mktemp)"
rm -rf /opt/Radarr
RELEASE=$(curl -fsSL https://api.github.com/repos/Radarr/Radarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/Radarr/Radarr/releases/download/v${RELEASE}/Radarr.master.${RELEASE}.linux-core-x64.tar.gz" -o "$temp_file"
$STD tar -xvzf "$temp_file"
mv Radarr /opt
chmod 775 /opt/Radarr
msg_ok "Updated $APP LXC"
RELEASE=$(curl -fsSL https://api.github.com/repos/Radarr/Radarr/releases/latest | jq -r '.tag_name' | sed 's/^v//')
if [[ ! -f ~/.radarr ]] || [[ "$RELEASE" != "$(cat ~/.radarr 2>/dev/null)" ]]; then
rm -rf /opt/Radarr
fetch_and_deploy_gh_release "Radarr" "Radarr/Radarr" "prebuild" "latest" "/opt/Radarr" "Radarr.master*linux-core-x64.tar.gz"
chmod 775 /opt/Radarr
msg_ok "Updated successfully"
else
msg_ok "No update required. $APP is already at v${RELEASE}"
fi
msg_info "Cleaning up"
rm -rf "$temp_file"
msg_ok "Cleaned up"
exit
}

View File

@ -17,23 +17,19 @@ msg_info "Installing Dependencies"
$STD apt-get install -y sqlite3
msg_ok "Installed Dependencies"
msg_info "Installing Radarr"
temp_file="$(mktemp)"
fetch_and_deploy_gh_release "Radarr" "Radarr/Radarr" "prebuild" "latest" "/opt/Radarr" "Radarr.master*linux-core-x64.tar.gz"
msg_info "Configuring Radarr"
mkdir -p /var/lib/radarr/
chmod 775 /var/lib/radarr/
cd /var/lib/radarr/
RELEASE=$(curl -fsSL https://api.github.com/repos/Radarr/Radarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/Radarr/Radarr/releases/download/v${RELEASE}/Radarr.master.${RELEASE}.linux-core-x64.tar.gz" -o "$temp_file"
$STD tar -xvzf "$temp_file"
mv Radarr /opt
chmod 775 /opt/Radarr
msg_ok "Installed Radarr"
chmod 775 /var/lib/radarr/ /opt/Radarr/
msg_ok "Configured Radarr"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/radarr.service
[Unit]
Description=Radarr Daemon
After=syslog.target network.target
[Service]
UMask=0002
Type=simple
@ -41,6 +37,7 @@ ExecStart=/opt/Radarr/Radarr -nobrowser -data=/var/lib/radarr/
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
@ -51,7 +48,6 @@ motd_ssh
customize
msg_info "Cleaning up"
rm -rf "$temp_file"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"