mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-07-24 14:52:53 +02:00
a35e496d93
Refactors a large set of CT update scripts to use the shared `create_backup`/`restore_backup` helpers instead of per-script manual copy/move logic. This removes duplicated backup code, temp-file cleanup paths, and inconsistent restore behavior while keeping data/config restoration in the correct order for build/deploy steps. Several update paths were also aligned to use `CLEAN_INSTALL=1` during release deploys, with minor message/comment tweaks where restore timing is important.
93 lines
2.8 KiB
Bash
93 lines
2.8 KiB
Bash
#!/usr/bin/env bash
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: vhsdream
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/slskd/slskd/, https://github.com/mrusse/soularr
|
|
|
|
APP="slskd"
|
|
var_tags="${var_tags:-arr;p2p}"
|
|
var_cpu="${var_cpu:-1}"
|
|
var_ram="${var_ram:-512}"
|
|
var_disk="${var_disk:-4}"
|
|
var_os="${var_os:-debian}"
|
|
var_version="${var_version:-13}"
|
|
var_arm64="${var_arm64:-yes}"
|
|
var_unprivileged="${var_unprivileged:-1}"
|
|
|
|
header_info "$APP"
|
|
variables
|
|
color
|
|
catch_errors
|
|
|
|
function update_script() {
|
|
header_info
|
|
check_container_storage
|
|
check_container_resources
|
|
|
|
if [[ ! -d /opt/slskd ]]; then
|
|
msg_error "No Slskd Installation Found!"
|
|
exit
|
|
fi
|
|
|
|
if check_for_gh_release "Slskd" "slskd/slskd"; then
|
|
msg_info "Stopping Service(s)"
|
|
systemctl stop slskd
|
|
[[ -f /etc/systemd/system/soularr.service ]] && systemctl stop soularr.timer soularr.service
|
|
msg_ok "Stopped Service(s)"
|
|
|
|
create_backup /opt/slskd/config/slskd.yml
|
|
|
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Slskd" "slskd/slskd" "prebuild" "latest" "/opt/slskd" "slskd-*-linux-$(arch_resolve "x64" "arm64").zip"
|
|
|
|
restore_backup
|
|
|
|
msg_info "Migrating config"
|
|
# Migrate 0.25.0 breaking config key renames
|
|
sed -i 's/^global:/transfers:/' /opt/slskd/config/slskd.yml
|
|
sed -i 's/^integration:/integrations:/' /opt/slskd/config/slskd.yml
|
|
msg_ok "Migrated config"
|
|
|
|
msg_info "Starting Service(s)"
|
|
systemctl start slskd
|
|
[[ -f /etc/systemd/system/soularr.service ]] && systemctl start soularr.timer
|
|
msg_ok "Started Service(s)"
|
|
msg_ok "Updated Slskd successfully!"
|
|
fi
|
|
[[ -d /opt/soularr ]] && if check_for_gh_release "Soularr" "mrusse/soularr"; then
|
|
if systemctl is-active soularr.timer >/dev/null; then
|
|
msg_info "Stopping Timer and Service"
|
|
systemctl stop soularr.timer soularr.service
|
|
msg_ok "Stopped Timer and Service"
|
|
fi
|
|
|
|
create_backup /opt/soularr/config.ini /opt/soularr/run.sh
|
|
|
|
PYTHON_VERSION="3.11" setup_uv
|
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Soularr" "mrusse/soularr" "tarball" "latest" "/opt/soularr"
|
|
restore_backup
|
|
msg_info "Updating Soularr"
|
|
cd /opt/soularr
|
|
$STD uv venv -c venv
|
|
$STD source venv/bin/activate
|
|
$STD uv pip install -r requirements.txt
|
|
deactivate
|
|
msg_ok "Updated Soularr"
|
|
|
|
msg_info "Starting Soularr Timer"
|
|
systemctl restart soularr.timer
|
|
msg_ok "Started Soularr Timer"
|
|
msg_ok "Updated Soularr successfully!"
|
|
fi
|
|
exit
|
|
}
|
|
|
|
start
|
|
build_container
|
|
description
|
|
|
|
msg_ok "Completed successfully!\n"
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
|
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
|
echo -e "${GATEWAY}${BGN}http://${IP}:5030${CL}"
|