Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/misc/build.func)
|
source <(curl -fsSL https://git.bila.li/Proxmox/proxmox-ve-install-scripts/raw/branch/dev/misc/build.func)
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: [YourUserName]
|
# Author: BiluliB
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: [SOURCE_URL]
|
# Source: [SOURCE_URL]
|
||||||
|
|
||||||
@ -25,15 +25,15 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
# Check if installation is present | -f for file, -d for folder
|
# Check for Python app with hardcoded path
|
||||||
if [[ ! -f /opt/huntarr/huntarr ]]; then
|
if [[ ! -f /opt/huntarr/main.py ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Crawling the new version and checking whether an update is required
|
# Crawling the new version and checking whether an update is required
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
|
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/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat /opt/huntarr_version.txt 2>/dev/null)" ]] || [[ ! -f /opt/huntarr_version.txt ]]; then
|
||||||
# Stopping Services
|
# Stopping Services
|
||||||
msg_info "Stopping $APP"
|
msg_info "Stopping $APP"
|
||||||
systemctl stop huntarr
|
systemctl stop huntarr
|
||||||
@ -41,20 +41,18 @@ function update_script() {
|
|||||||
|
|
||||||
# Creating Backup
|
# Creating Backup
|
||||||
msg_info "Creating Backup"
|
msg_info "Creating Backup"
|
||||||
# Remove any existing backups
|
tar -czf "/opt/huntarr_backup_$(date +%F).tar.gz" /opt/huntarr
|
||||||
if ls /opt/${APP}_backup_*.tar.gz &>/dev/null; then
|
|
||||||
rm -f /opt/${APP}_backup_*.tar.gz
|
|
||||||
msg_info "Removed previous backup"
|
|
||||||
fi
|
|
||||||
# Create new backup
|
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/huntarr
|
|
||||||
msg_ok "Backup Created"
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
# Execute Update
|
# Execute Update for Python app
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
msg_info "Updating $APP to v${RELEASE}"
|
||||||
curl -fsSL -o "/opt/huntarr/huntarr_${RELEASE}_linux_amd64.tar.gz" "https://github.com/plexguide/Huntarr.io/releases/download/${RELEASE}/huntarr_${RELEASE}_linux_amd64.tar.gz"
|
curl -fsSL -o "/opt/huntarr/${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip"
|
||||||
tar -xzf "/opt/huntarr/huntarr_${RELEASE}_linux_amd64.tar.gz" -C /opt/huntarr
|
unzip -q -o "/opt/huntarr/${RELEASE}.zip" -d /tmp
|
||||||
chmod +x /opt/huntarr/huntarr
|
cp -rf "/tmp/Huntarr.io-${RELEASE}"/* /opt/huntarr/
|
||||||
|
|
||||||
|
# Update Python dependencies
|
||||||
|
cd /opt/huntarr || exit
|
||||||
|
/opt/huntarr/venv/bin/pip install -r requirements.txt
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
msg_ok "Updated $APP to v${RELEASE}"
|
||||||
|
|
||||||
# Starting Services
|
# Starting Services
|
||||||
@ -64,11 +62,12 @@ function update_script() {
|
|||||||
|
|
||||||
# Cleaning up
|
# Cleaning up
|
||||||
msg_info "Cleaning Up"
|
msg_info "Cleaning Up"
|
||||||
rm -f /opt/huntarr/huntarr_"${RELEASE}"_linux_amd64.tar.gz
|
rm -f "/opt/huntarr/${RELEASE}.zip"
|
||||||
|
rm -rf "/tmp/Huntarr.io-${RELEASE}"
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
# Last Action
|
# Last Action
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
echo "${RELEASE}" >/opt/huntarr_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}"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: [YourUserName]
|
# Author: BiluliB
|
||||||
# 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
|
||||||
|
|
||||||
@ -17,7 +17,6 @@ update_os
|
|||||||
APPLICATION="huntarr"
|
APPLICATION="huntarr"
|
||||||
REPO_NAME="Huntarr.io"
|
REPO_NAME="Huntarr.io"
|
||||||
|
|
||||||
# Installing Dependencies
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
@ -29,7 +28,6 @@ $STD apt-get install -y \
|
|||||||
python3-venv
|
python3-venv
|
||||||
msg_ok "Installed System Dependencies"
|
msg_ok "Installed System Dependencies"
|
||||||
|
|
||||||
# Setup App
|
|
||||||
msg_info "Setup ${APPLICATION}"
|
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) }')
|
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"
|
curl -fsSL -o "${RELEASE}.zip" "https://github.com/plexguide/Huntarr.io/archive/refs/tags/${RELEASE}.zip"
|
||||||
@ -39,18 +37,15 @@ mv "${REPO_NAME}-${RELEASE}/" "/opt/${APPLICATION}"
|
|||||||
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
|
||||||
msg_ok "Setup ${APPLICATION}"
|
msg_ok "Setup ${APPLICATION}"
|
||||||
|
|
||||||
# Setup Python Environment
|
|
||||||
msg_info "Setting up Python Environment"
|
msg_info "Setting up Python Environment"
|
||||||
$STD python3 -m venv /opt/${APPLICATION}/venv
|
$STD python3 -m venv /opt/${APPLICATION}/venv
|
||||||
msg_ok "Created Python Virtual Environment"
|
msg_ok "Created Python Virtual Environment"
|
||||||
|
|
||||||
# Install Python Dependencies
|
|
||||||
msg_info "Installing Python Dependencies"
|
msg_info "Installing Python Dependencies"
|
||||||
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
|
$STD /opt/${APPLICATION}/venv/bin/pip install --upgrade pip
|
||||||
$STD /opt/${APPLICATION}/venv/bin/pip install -r /opt/${APPLICATION}/requirements.txt
|
$STD /opt/${APPLICATION}/venv/bin/pip install -r /opt/${APPLICATION}/requirements.txt
|
||||||
msg_ok "Installed Python Dependencies"
|
msg_ok "Installed Python Dependencies"
|
||||||
|
|
||||||
# Creating Service (if needed)
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
|
||||||
[Unit]
|
[Unit]
|
||||||
@ -72,7 +67,6 @@ msg_ok "Created Service"
|
|||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
msg_info "Cleaning up"
|
msg_info "Cleaning up"
|
||||||
rm -f "${RELEASE}.zip"
|
rm -f "${RELEASE}.zip"
|
||||||
$STD apt-get -y autoremove
|
$STD apt-get -y autoremove
|
||||||
|
|||||||
Reference in New Issue
Block a user