diff --git a/ct/wizarr.sh b/ct/wizarr.sh index 88b21cd9..ce521e5a 100644 --- a/ct/wizarr.sh +++ b/ct/wizarr.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: vhsdream # License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE @@ -29,8 +29,8 @@ function update_script() { exit fi - RELEASE=$(curl -s https://api.github.com/repos/wizarrrr/wizarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') - if [[ "${RELEASE}" != "$(cat /opt/wizarr_version.txt)" ]] || [[ ! -f /opt/wizarr_version.txt ]]; then + RELEASE=$(curl -fsSL https://api.github.com/repos/wizarrrr/wizarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') + if [[ "${RELEASE}" != "$(cat ~/.wizarr 2>/dev/null)" ]] || [[ ! -f ~/.wizarr ]]; then msg_info "Stopping $APP" systemctl stop wizarr msg_ok "Stopped $APP" @@ -40,13 +40,11 @@ function update_script() { $STD tar -czf "$BACKUP_FILE" /opt/wizarr/{.env,start.sh} /opt/wizarr/database/ &>/dev/null msg_ok "Backup Created" - msg_info "Updating $APP to v${RELEASE}" - rm -rf /opt/wizarr - curl -fsSL "https://github.com/wizarrrr/wizarr/archive/refs/tags/${RELEASE}.zip" -o /tmp/"$RELEASE".zip - unzip -q /tmp/"$RELEASE".zip - mv wizarr-${RELEASE}/ /opt/wizarr - cd /opt/wizarr setup_uv + fetch_and_deploy_gh_release "wizarr" "wizarrrr/wizarr" + + msg_info "Updating $APP to v${RELEASE}" + cd /opt/wizarr uv -q sync --locked $STD uv -q run pybabel compile -d app/translations $STD npm --prefix app/static install @@ -64,8 +62,6 @@ function update_script() { rm -rf "$BACKUP_FILE" rm /tmp/"$RELEASE".zip msg_ok "Cleanup Completed" - - echo "${RELEASE}" >/opt/wizarr_version.txt msg_ok "Update Successful" else msg_ok "No update required. ${APP} is already at v${RELEASE}" diff --git a/install/wizarr-install.sh b/install/wizarr-install.sh index 0ec81c51..d4d40d70 100644 --- a/install/wizarr-install.sh +++ b/install/wizarr-install.sh @@ -14,21 +14,14 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ - curl \ - sudo \ - mc \ - sqlite3 +$STD apt-get install -y sqlite3 msg_ok "Installed Dependencies" setup_uv NODE_VERSION="22" setup_nodejs msg_info "Installing ${APPLICATION}" -RELEASE=$(curl -s https://api.github.com/repos/wizarrrr/wizarr/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -curl -fsSL "https://github.com/wizarrrr/wizarr/archive/refs/tags/${RELEASE}.zip" -o /tmp/"$RELEASE".zip -unzip -q /tmp/"$RELEASE".zip -mv wizarr-${RELEASE}/ /opt/wizarr +fetch_and_deploy_gh_release "wizarr" "wizarrrr/wizarr" cd /opt/wizarr uv -q sync --locked $STD uv -q run pybabel compile -d app/translations @@ -75,14 +68,13 @@ Restart=on-abnormal [Install] WantedBy=multi-user.target EOF -systemctl enable -q --now wizarr.service +systemctl enable -q --now wizarr msg_ok "Created env, start script and service" motd_ssh customize msg_info "Cleaning up" -rm -f /tmp/"$RELEASE".zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"