From f0610091bbd3f8e80ac39e24b9cfbc4a5de316172ffc7bec4b851f09e311f854 Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Sat, 22 Aug 2026 06:00:44 +0200 Subject: [PATCH] fail curl on http errors --- install.sh | 4 ++-- pbc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index b171d6c..bdb3a08 100755 --- a/install.sh +++ b/install.sh @@ -18,7 +18,7 @@ function download_files() { while (( $# > 0 )); do path=$1 shift - curl -s --output-dir "$TMPDIR/" --remote-name "$API_ENDPOINT/raw/$path$query_params" + curl -fsSL --output-dir "$TMPDIR/" --remote-name "$API_ENDPOINT/raw/$path$query_params" rc=$? if (( $rc != 0 )); then return $rc @@ -26,7 +26,7 @@ function download_files() { done } -GIT_TAG=$(curl -s "$API_ENDPOINT/tags" | jq -r '.[] | .name' | sort --version-sort | tail -n 1) +GIT_TAG=$(curl -fsSL "$API_ENDPOINT/tags" | jq -r '.[] | .name' | sort --version-sort | tail -n 1) if [ -n "$GIT_TAG" ]; then echo "Info: installing pbc version $GIT_TAG" else diff --git a/pbc b/pbc index 2790157..92c04e2 100755 --- a/pbc +++ b/pbc @@ -137,14 +137,14 @@ function install_proxmox_backup_client() { $update && local action='Updating' || local action='Installing' echo "$action proxmox-backup-client-static binary ..." - local pkgfile=$(curl -s "$PBC_DOWNLOAD_URL/" | grep proxmox-backup-client-static_ | tail -n 1 | sed 's#.*href="##g;s#".*##g;') + local pkgfile=$(curl -fsSL "$PBC_DOWNLOAD_URL/" | grep proxmox-backup-client-static_ | tail -n 1 | sed 's#.*href="##g;s#".*##g;') [ -z "$pkgfile" ] && echo "Unable to determine current package file!" >&2 && return 30 TMPDIR=$(mktemp -d) trap cleanup_tmpdir EXIT echo "Info: downloading $PBC_DOWNLOAD_URL/$pkgfile ..." - ! curl -s -o "$TMPDIR/$pkgfile" "$PBC_DOWNLOAD_URL/$pkgfile" && echo "Error downloading file!" >&2 && return 40 + ! curl -fsSL -o "$TMPDIR/$pkgfile" "$PBC_DOWNLOAD_URL/$pkgfile" && echo "Error downloading file!" >&2 && return 40 echo "Info: extracting $pkgfile ..." ! dpkg-deb -x "$TMPDIR/$pkgfile" "$TMPDIR/" && echo "Error extracting file!" >&2 && return 50