Refactor (#6379)
This commit is contained in:
parent
2c618f53ca
commit
af88ff3dd4
29
ct/lidarr.sh
29
ct/lidarr.sh
@ -29,19 +29,24 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Updating $APP LXC"
|
RELEASE=$(curl -fsSL https://api.github.com/repos/Lidarr/Lidarr/releases/latest | jq -r '.tag_name' | sed 's/^v//')
|
||||||
temp_file="$(mktemp)"
|
if [[ "${RELEASE}" != "$(cat ~/.lidarr)" ]] || [[ ! -f ~/.lidarr ]]; then
|
||||||
rm -rf /opt/Lidarr
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Lidarr/Lidarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
|
||||||
curl -fsSL "https://github.com/Lidarr/Lidarr/releases/download/v${RELEASE}/Lidarr.master.${RELEASE}.linux-core-x64.tar.gz" -o "$temp_file"
|
|
||||||
$STD tar -xvzf "$temp_file"
|
|
||||||
mv Lidarr /opt
|
|
||||||
chmod 775 /opt/Lidarr
|
|
||||||
msg_ok "Updated $APP LXC"
|
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Stopping service"
|
||||||
rm -rf "$temp_file"
|
systemctl stop lidarr
|
||||||
msg_ok "Cleaned up"
|
msg_ok "Service stopped"
|
||||||
|
|
||||||
|
fetch_and_deploy_gh_release "lidarr" "Lidarr/Lidarr" "prebuild" "latest" "/opt/Lidarr" "Lidarr.master*linux-core-x64.tar.gz"
|
||||||
|
chmod 775 /opt/Lidarr
|
||||||
|
|
||||||
|
msg_info "Starting service"
|
||||||
|
systemctl start lidarr
|
||||||
|
msg_ok "Service started"
|
||||||
|
|
||||||
|
msg_ok "Updated successfully"
|
||||||
|
else
|
||||||
|
msg_ok "No update required. ${APP} is already at ${RELEASE}"
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 8686,
|
"interface_port": 8686,
|
||||||
"documentation": null,
|
"documentation": "https://wiki.servarr.com/en/lidarr",
|
||||||
"website": "https://lidarr.audio/",
|
"website": "https://lidarr.audio/",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/lidarr.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/lidarr.webp",
|
||||||
"config_path": "",
|
"config_path": "/var/lib/lidarr/config.xml",
|
||||||
"description": "Lidarr is a music management tool designed for Usenet and BitTorrent users. It allows users to manage and organize their music collection with ease. Lidarr integrates with popular Usenet and BitTorrent clients, such as Sonarr and Radarr, to automate the downloading and organizing of music files. The software provides a web-based interface for managing and organizing music, making it easy to search and find songs, albums, and artists. Lidarr also supports metadata management, including album art, artist information, and lyrics, making it easy for users to keep their music collection organized and up-to-date. The software is designed to be easy to use and provides a simple and intuitive interface for managing and organizing music collections, making it a valuable tool for music lovers who want to keep their collection organized and up-to-date. With Lidarr, users can enjoy their music collection from anywhere, making it a powerful tool for managing and sharing music files.",
|
"description": "Lidarr is a music management tool designed for Usenet and BitTorrent users. It allows users to manage and organize their music collection with ease. Lidarr integrates with popular Usenet and BitTorrent clients, such as Sonarr and Radarr, to automate the downloading and organizing of music files. The software provides a web-based interface for managing and organizing music, making it easy to search and find songs, albums, and artists. Lidarr also supports metadata management, including album art, artist information, and lyrics, making it easy for users to keep their music collection organized and up-to-date. The software is designed to be easy to use and provides a simple and intuitive interface for managing and organizing music collections, making it a valuable tool for music lovers who want to keep their collection organized and up-to-date. With Lidarr, users can enjoy their music collection from anywhere, making it a powerful tool for managing and sharing music files.",
|
||||||
"install_methods": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
|
@ -20,22 +20,20 @@ $STD apt-get install -y \
|
|||||||
mediainfo
|
mediainfo
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Installing Lidarr"
|
fetch_and_deploy_gh_release "lidarr" "Lidarr/Lidarr" "prebuild" "latest" "/opt/Lidarr" "Lidarr.master*linux-core-x64.tar.gz"
|
||||||
temp_file="$(mktemp)"
|
|
||||||
|
msg_info "Configuring Lidarr"
|
||||||
mkdir -p /var/lib/lidarr/
|
mkdir -p /var/lib/lidarr/
|
||||||
chmod 775 /var/lib/lidarr/
|
chmod 775 /var/lib/lidarr/
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/Lidarr/Lidarr/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
|
|
||||||
curl -fsSL "https://github.com/Lidarr/Lidarr/releases/download/v${RELEASE}/Lidarr.master.${RELEASE}.linux-core-x64.tar.gz" -o "$temp_file"
|
|
||||||
$STD tar -xvzf "$temp_file"
|
|
||||||
mv Lidarr /opt
|
|
||||||
chmod 775 /opt/Lidarr
|
chmod 775 /opt/Lidarr
|
||||||
msg_ok "Installed Lidarr"
|
msg_ok "Configured Lidarr"
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/lidarr.service
|
cat <<EOF >/etc/systemd/system/lidarr.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Lidarr Daemon
|
Description=Lidarr Daemon
|
||||||
After=syslog.target network.target
|
After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
UMask=0002
|
UMask=0002
|
||||||
Type=simple
|
Type=simple
|
||||||
@ -43,6 +41,7 @@ ExecStart=/opt/Lidarr/Lidarr -nobrowser -data=/var/lib/lidarr/
|
|||||||
TimeoutStopSec=20
|
TimeoutStopSec=20
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
@ -53,7 +52,6 @@ motd_ssh
|
|||||||
customize
|
customize
|
||||||
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -rf "$temp_file"
|
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
$STD apt-get -y autoclean
|
$STD apt-get -y autoclean
|
||||||
msg_ok "Cleaned"
|
msg_ok "Cleaned"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user