parent
52a9ad733d
commit
e7ccf9a512
21
ct/radarr.sh
21
ct/radarr.sh
@ -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
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user