Update huntarr.sh, huntarr-install.sh, huntarr.json

This commit is contained in:
bilulib 2025-05-17 03:37:01 +02:00
parent 20c2724403
commit 9b4e8f4236
3 changed files with 28 additions and 40 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/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: BiluliB
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
@ -30,23 +30,11 @@ function update_script() {
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
if [[ "${RELEASE}" != "$(cat /opt/huntarr_version.txt 2>/dev/null)" ]] || [[ ! -f /opt/huntarr_version.txt ]]; then
if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Stopping $APP"
systemctl stop huntarr
msg_ok "Stopped $APP"
msg_info "Checking system dependencies"
$STD apt-get update
$STD apt-get install -y \
curl \
tar \
unzip \
jq \
python3 \
python3-pip \
python3-venv
msg_ok "System dependencies updated"
msg_info "Creating Backup"
if ls /opt/${APP}_backup_*.tar.gz &>/dev/null; then
rm -f /opt/${APP}_backup_*.tar.gz
@ -68,15 +56,19 @@ function update_script() {
if [[ "$CURRENT_CHECKSUM" != "$STORED_CHECKSUM" ]]; then
msg_info "Requirements have changed. Performing full upgrade."
/opt/huntarr/venv/bin/pip install --upgrade -r requirements.txt
uv pip install -r requirements.txt --python /opt/huntarr/venv/bin/python
else
msg_info "Requirements unchanged. Verifying installation."
/opt/huntarr/venv/bin/pip install -r requirements.txt
uv pip install -r requirements.txt --python /opt/huntarr/venv/bin/python
fi
else
/opt/huntarr/venv/bin/pip install --upgrade -r requirements.txt
if ! command -v uv &>/dev/null; then
msg_info "Installing UV package manager"
curl -LsSf https://astral.sh/uv/install.sh | sh
msg_ok "UV package manager installed"
fi
uv pip install -r requirements.txt --python /opt/huntarr/venv/bin/python
fi
md5sum requirements.txt | awk '{print $1}' >.requirements_checksum
msg_ok "Updated Python dependencies"
msg_ok "Updated $APP to v${RELEASE}"
@ -92,6 +84,8 @@ function update_script() {
echo "${RELEASE}" >/opt/huntarr_version.txt
msg_ok "Update Successful"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi
exit
}

View File

@ -2,7 +2,7 @@
"name": "Huntarr",
"slug": "huntarr",
"categories": [
0
14
],
"date_created": "2025-05-12",
"type": "ct",

View File

@ -17,33 +17,27 @@ APPLICATION="huntarr"
REPO_NAME="Huntarr.io"
msg_info "Installing Dependencies"
$STD apt-get install -y jq
msg_ok "Installed Dependencies"
msg_info "Installing Python"
$STD apt-get install -y \
curl \
tar \
unzip \
jq \
python3 \
python3-pip \
python3-venv
msg_ok "Installed System Dependencies"
$STD bash -c "curl -LsSf https://astral.sh/uv/install.sh | sh"
export PATH="/root/.local/bin:$HOME/.cargo/bin:$PATH"
command -v uv &>/dev/null
msg_ok "Installed Python"
msg_info "Setup ${APPLICATION}"
msg_info "Setting Up ${APPLICATION}"
RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL -o "${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip"
unzip -q "${RELEASE}.zip"
mv "${REPO_NAME}-${RELEASE}/" "/opt/${APPLICATION}"
$STD curl -fsSL -o "${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip"
$STD unzip -q "${RELEASE}.zip"
$STD mv "${REPO_NAME}-${RELEASE}/" "/opt/${APPLICATION}"
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Setup ${APPLICATION}"
msg_info "Setting up Python Environment"
$STD python3 -m venv /opt/${APPLICATION}/venv
msg_ok "Created Python Virtual Environment"
msg_info "Installing Python Dependencies"
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
$STD /opt/${APPLICATION}/venv/bin/pip install -r /opt/${APPLICATION}/requirements.txt
msg_ok "Installed Python Dependencies"
$STD uv venv /opt/${APPLICATION}/venv
$STD uv pip install --python /opt/${APPLICATION}/venv/bin/python -r /opt/${APPLICATION}/requirements.txt
msg_ok "Setup ${APPLICATION} Complete"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/${APPLICATION}.service