standard-build/backup/fetch-borg-latest.sh

17 lines
539 B
Bash
Raw Normal View History

2023-08-25 23:05:43 +01:00
#!/bin/sh
set -e
2023-08-27 21:37:15 +01:00
download_version=$(curl -s https://api.github.com/repos/borgbackup/borg/releases/latest | jq -r '.name')
download_url=$(curl -s https://api.github.com/repos/borgbackup/borg/releases/latest | jq -r '.assets | .[] | select(.name == "borg-linux64") | .browser_download_url')
2023-08-27 21:35:39 +01:00
echo "Version: $download_version"
echo "URL: $download_url"
echo 'Continue (y/N)?'
read answer
if [ "$answer" == "${answer#[Yy]}" ] ;then
exit 1
fi
wget -4 -O /usr/local/bin/borg-linux64 $download_url
2023-08-25 23:05:43 +01:00
chmod -v +x /usr/local/bin/borg-linux64