Files
ProxmoxVE/ct/watcharr.sh
T

72 lines
2.0 KiB
Bash
Raw Normal View History

2025-02-11 11:45:25 +01:00
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
2025-02-11 11:45:25 +01:00
# Author: Slaviša Arežina (tremor021)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/sbondCo/Watcharr
APP="Watcharr"
var_tags="${var_tags:-media}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
2025-10-07 21:40:31 +02:00
var_version="${var_version:-13}"
2026-06-12 00:16:15 +10:00
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
2025-02-11 11:45:25 +01:00
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/watcharr ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
2025-02-11 11:45:25 +01:00
if check_for_gh_release "watcharr" "sbondCo/Watcharr"; then
2025-10-07 21:40:31 +02:00
msg_info "Stopping Service"
systemctl stop watcharr
2025-10-07 21:40:31 +02:00
msg_ok "Stopped Service"
2025-08-15 12:57:00 +02:00
NODE_VERSION="24" setup_nodejs
2026-06-15 21:33:12 +02:00
create_backup /opt/watcharr/server/data
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "watcharr" "sbondCo/Watcharr" "tarball"
GO_VERSION="$(grep -m1 '^go ' /opt/watcharr/server/go.mod | awk '{print $2}')" setup_go
2026-06-15 21:33:12 +02:00
restore_backup
2025-02-11 11:45:25 +01:00
2025-10-07 21:40:31 +02:00
msg_info "Updating Watcharr"
2026-01-06 13:45:03 +01:00
cd /opt/watcharr
export GOOS=linux
$STD npm i
$STD npm run build
mv ./build ./server/ui
2026-01-06 13:45:03 +01:00
cd server
$STD go mod download
$STD go build -o ./watcharr
2025-10-07 21:40:31 +02:00
msg_ok "Updated Watcharr"
2025-02-11 11:45:25 +01:00
2025-10-07 21:40:31 +02:00
msg_info "Starting Service"
systemctl start watcharr
2025-10-07 21:40:31 +02:00
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
2025-02-11 11:45:25 +01:00
}
start
build_container
description
2026-01-06 22:57:40 +01:00
msg_ok "Completed successfully!\n"
2025-02-11 11:45:25 +01:00
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}:3080${CL}"