SHA256
fail curl on http errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user