fix huntarr-install naming issues

This commit is contained in:
bilulib
2025-05-09 19:19:04 +02:00
parent b32ed526e0
commit b1edeec8c7
3 changed files with 24 additions and 7 deletions

View File

@ -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 <<EOF >/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"