fix: standardize APP variable to lowercase "huntarr" for consistent paths

This commit is contained in:
bilulib 2025-05-17 18:04:51 +02:00
parent 9b4e8f4236
commit 0ee953df64

View File

@ -5,7 +5,7 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/plexguide/Huntarr.io # Source: https://github.com/plexguide/Huntarr.io
APP="Huntarr" APP="huntarr"
var_tags="${var_tags:-arr}" var_tags="${var_tags:-arr}"
var_cpu="${var_cpu:-2}" var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}" var_ram="${var_ram:-1024}"
@ -36,30 +36,30 @@ function update_script() {
msg_ok "Stopped $APP" msg_ok "Stopped $APP"
msg_info "Creating Backup" msg_info "Creating Backup"
if ls /opt/${APP}_backup_*.tar.gz &>/dev/null; then if ls /opt/"${APP}"_backup_*.tar.gz &>/dev/null; then
rm -f /opt/${APP}_backup_*.tar.gz rm -f /opt/"${APP}"_backup_*.tar.gz
msg_info "Removed previous backup" msg_info "Removed previous backup"
fi fi
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/huntarr tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/"${APP}"
msg_ok "Backup Created" msg_ok "Backup Created"
msg_info "Updating $APP to v${RELEASE}" msg_info "Updating $APP to v${RELEASE}"
curl -fsSL -o "/opt/huntarr/${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip" curl -fsSL -o "/opt/${APP}/${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip"
unzip -q -o "/opt/huntarr/${RELEASE}.zip" -d /tmp unzip -q -o "/opt/${APP}/${RELEASE}.zip" -d /tmp
cp -rf "/tmp/Huntarr.io-${RELEASE}"/* /opt/huntarr/ cp -rf "/tmp/Huntarr.io-${RELEASE}"/* /opt/"${APP}"/
msg_info "Updating Python dependencies" msg_info "Updating Python dependencies"
cd /opt/huntarr || exit cd /opt/"${APP}" || exit
if [[ -f "/opt/huntarr/.requirements_checksum" ]]; then if [[ -f "/opt/${APP}/.requirements_checksum" ]]; then
CURRENT_CHECKSUM=$(md5sum requirements.txt | awk '{print $1}') CURRENT_CHECKSUM=$(md5sum requirements.txt | awk '{print $1}')
STORED_CHECKSUM=$(cat .requirements_checksum) STORED_CHECKSUM=$(cat .requirements_checksum)
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
msg_info "Requirements have changed. Performing full upgrade." msg_info "Requirements have changed. Performing full upgrade."
uv pip install -r requirements.txt --python /opt/huntarr/venv/bin/python uv pip install -r requirements.txt --python /opt/"${APP}"/venv/bin/python
else else
msg_info "Requirements unchanged. Verifying installation." msg_info "Requirements unchanged. Verifying installation."
uv pip install -r requirements.txt --python /opt/huntarr/venv/bin/python uv pip install -r requirements.txt --python /opt/"${APP}"/venv/bin/python
fi fi
else else
if ! command -v uv &>/dev/null; then if ! command -v uv &>/dev/null; then
@ -67,7 +67,7 @@ function update_script() {
curl -LsSf https://astral.sh/uv/install.sh | sh curl -LsSf https://astral.sh/uv/install.sh | sh
msg_ok "UV package manager installed" msg_ok "UV package manager installed"
fi fi
uv pip install -r requirements.txt --python /opt/huntarr/venv/bin/python uv pip install -r requirements.txt --python /opt/"${APP}"/venv/bin/python
fi fi
md5sum requirements.txt | awk '{print $1}' >.requirements_checksum md5sum requirements.txt | awk '{print $1}' >.requirements_checksum
msg_ok "Updated Python dependencies" msg_ok "Updated Python dependencies"
@ -78,11 +78,11 @@ function update_script() {
msg_ok "Started $APP" msg_ok "Started $APP"
msg_info "Cleaning Up" msg_info "Cleaning Up"
rm -f "/opt/huntarr/${RELEASE}.zip" rm -f "/opt/${APP}/${RELEASE}.zip"
rm -rf "/tmp/Huntarr.io-${RELEASE}" rm -rf "/tmp/Huntarr.io-${RELEASE}"
msg_ok "Cleanup Completed" msg_ok "Cleanup Completed"
echo "${RELEASE}" >/opt/huntarr_version.txt echo "${RELEASE}" >/opt/"${APP}"_version.txt
msg_ok "Update Successful" msg_ok "Update Successful"
else else
msg_ok "No update required. ${APP} is already at v${RELEASE}" msg_ok "No update required. ${APP} is already at v${RELEASE}"