fix github api url
This commit is contained in:
@ -31,7 +31,10 @@ function update_script() {
|
|||||||
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)}')
|
LATEST_JSON=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest)
|
||||||
|
RELEASE=$(echo "$LATEST_JSON" | grep '"tag_name":' | head -1 | cut -d '"' -f4)
|
||||||
|
DOWNLOAD_URL=$(echo "$LATEST_JSON" | grep 'browser_download_url' | grep linux_amd64.tar.gz | cut -d '"' -f4)
|
||||||
|
TAR_FILE=$(basename "$DOWNLOAD_URL")
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
# Stopping Services
|
# Stopping Services
|
||||||
msg_info "Stopping $APP"
|
msg_info "Stopping $APP"
|
||||||
@ -45,9 +48,9 @@ function update_script() {
|
|||||||
|
|
||||||
# Execute Update
|
# Execute Update
|
||||||
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/${APP}/${TAR_FILE}" "$DOWNLOAD_URL"
|
||||||
tar -xzf "/opt/huntarr/huntarr_${RELEASE}_linux_amd64.tar.gz" -C /opt/huntarr
|
tar -xzf "/opt/${APP}/${TAR_FILE}" -C /opt/${APP}
|
||||||
chmod +x /opt/huntarr/huntarr
|
chmod +x /opt/${APP}/${APP}
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
msg_ok "Updated $APP to v${RELEASE}"
|
||||||
|
|
||||||
# Starting Services
|
# Starting Services
|
||||||
@ -57,7 +60,7 @@ 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/${APP}/${TAR_FILE}"
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
# Last Action
|
# Last Action
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SPINNER_PID=0
|
||||||
|
|
||||||
# Copyright (c) 2021-2025 community-scripts ORG
|
# Copyright (c) 2021-2025 community-scripts ORG
|
||||||
# Author: [YourUserName]
|
# Author: [YourUserName]
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
@ -15,21 +17,25 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
APPLICATION="huntarr"
|
APPLICATION="huntarr"
|
||||||
SPINNER_PID=0
|
|
||||||
|
|
||||||
# Installing Dependencies
|
# Installing Dependencies
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
curl \
|
curl \
|
||||||
tar \
|
tar \
|
||||||
unzip
|
unzip \
|
||||||
|
jq
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
# Setup App
|
# Setup App
|
||||||
msg_info "Setup ${APPLICATION}"
|
msg_info "Setup ${APPLICATION}"
|
||||||
LATEST_JSON=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest)
|
LATEST_JSON=$(curl -fsSL https://api.github.com/repos/plexguide/Huntarr.io/releases/latest)
|
||||||
RELEASE=$(echo "$LATEST_JSON" | grep '"tag_name":' | head -1 | cut -d '"' -f4)
|
RELEASE=$(echo "$LATEST_JSON" | jq -r '.tag_name')
|
||||||
DOWNLOAD_URL=$(echo "$LATEST_JSON" | grep 'browser_download_url' | grep linux_amd64.tar.gz | cut -d '"' -f4)
|
DOWNLOAD_URL=$(echo "$LATEST_JSON" | jq -r '.assets[] | select(.name | test("linux_amd64\\.tar\\.gz")) | .browser_download_url')
|
||||||
|
if [[ -z "$DOWNLOAD_URL" ]]; then
|
||||||
|
msg_error "Failed to parse download URL"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
TAR_FILE=$(basename "$DOWNLOAD_URL")
|
TAR_FILE=$(basename "$DOWNLOAD_URL")
|
||||||
mkdir -p /opt/${APPLICATION}
|
mkdir -p /opt/${APPLICATION}
|
||||||
curl -fsSL -o "/opt/${APPLICATION}/${TAR_FILE}" "$DOWNLOAD_URL"
|
curl -fsSL -o "/opt/${APPLICATION}/${TAR_FILE}" "$DOWNLOAD_URL"
|
||||||
|
|||||||
Reference in New Issue
Block a user