Files
proxmox-ve-install-scripts/ct/huntarr.sh
2025-05-05 19:05:11 +02:00

96 lines
2.3 KiB
Bash

#!/usr/bin/env bash
source <(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/misc/build.func)
# Copyright (c) 2021-2025 tteck
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/huntarr/huntarr
APP="Huntarr"
var_tags="${var_tags:-arr}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /var/lib/huntarr/ ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating $APP LXC"
cd /opt/huntarr
HUNTARR_VERSION="${HUNTARR_VERSION:-6.2}"
$STD git fetch --all
$STD git checkout "v${HUNTARR_VERSION}"
$STD npm install
$STD npm run build
systemctl restart huntarr
msg_ok "Updated $APP LXC"
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned up"
exit
}
start
build_container
description
msg_info "Installing Dependencies"
$STD apt-get update
$STD apt-get install -y curl wget gnupg git openjdk-17-jdk nodejs npm
msg_ok "Installed Dependencies"
msg_info "Installing Huntarr"
mkdir -p /var/lib/huntarr/
chmod 775 /var/lib/huntarr/
$STD git clone https://github.com/huntarr/huntarr.git /opt/huntarr
cd /opt/huntarr
HUNTARR_VERSION="${HUNTARR_VERSION:-6.2}"
$STD git checkout "v${HUNTARR_VERSION}"
$STD npm install
$STD npm run build
msg_ok "Installed Huntarr"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/huntarr.service
[Unit]
Description=Huntarr Service
After=network.target
[Service]
UMask=0002
Type=simple
WorkingDirectory=/opt/huntarr
ExecStart=/usr/bin/npm start
Restart=on-failure
TimeoutStopSec=20
KillMode=process
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now huntarr
msg_ok "Created Service"
motd_ssh
customize
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${INFO}${GN} http://${BL}$(hostname)${GN}:3000${CL}\n"