From b1edeec8c7f515e2bda9c3e433f3e444c85892e3 Mon Sep 17 00:00:00 2001 From: bilulib Date: Fri, 9 May 2025 19:19:04 +0200 Subject: [PATCH] fix huntarr-install naming issues --- .gitignore | 1 + ct/huntarr.sh | 2 +- install/huntarr-install.sh | 28 ++++++++++++++++++++++------ 3 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7dd35dd --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Huntarr.io-6.3.6/ diff --git a/ct/huntarr.sh b/ct/huntarr.sh index 44724cb..afb48d8 100644 --- a/ct/huntarr.sh +++ b/ct/huntarr.sh @@ -6,7 +6,7 @@ source <(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/b # Source: [SOURCE_URL] # App Default Values -APP="huntarr" +APP="Huntarr" var_tags="${var_tags:-arr}" var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" diff --git a/install/huntarr-install.sh b/install/huntarr-install.sh index 4143808..4d2d367 100644 --- a/install/huntarr-install.sh +++ b/install/huntarr-install.sh @@ -15,6 +15,7 @@ network_check update_os APPLICATION="huntarr" +REPO_NAME="Huntarr.io" # Installing Dependencies msg_info "Installing Dependencies" @@ -22,29 +23,44 @@ $STD apt-get install -y \ curl \ tar \ unzip \ - jq -msg_ok "Installed Dependencies" + jq \ + python3 \ + python3-pip \ + python3-venv +msg_ok "Installed System Dependencies" # Setup App msg_info "Setup ${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 "${APPLICATION}-${RELEASE}/" "/opt/${APPLICATION}" +mv "${REPO_NAME}-${RELEASE}/" "/opt/${APPLICATION}" echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Setup ${APPLICATION}" +# Setup Python Environment +msg_info "Setting up Python Environment" +$STD python3 -m venv /opt/${APPLICATION}/venv +msg_ok "Created Python Virtual Environment" + +# Install Python Dependencies +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" + # Creating Service (if needed) msg_info "Creating Service" cat </etc/systemd/system/${APPLICATION}.service [Unit] -Description=${APPLICATION} Service +Description=Huntarr Service After=network.target [Service] Environment=TZ=Europe/Zurich -ExecStart=/opt/${APPLICATION}/${APPLICATION} --config /opt/${APPLICATION} --port 9705 +WorkingDirectory=/opt/${APPLICATION} +ExecStart=/opt/${APPLICATION}/venv/bin/python /opt/${APPLICATION}/main.py Restart=always [Install] @@ -58,7 +74,7 @@ customize # Cleanup msg_info "Cleaning up" -rm -f "/opt/${APPLICATION}/${TAR_FILE}" +rm -f "${RELEASE}.zip" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"