From 39a5d5c58b1b4f204bf462e0dffa494aafc02ccc Mon Sep 17 00:00:00 2001 From: Wouter Horlings Date: Sun, 31 Jan 2021 12:20:52 +0100 Subject: [PATCH] Add restic install script --- restic-install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 restic-install.sh diff --git a/restic-install.sh b/restic-install.sh new file mode 100644 index 0000000..b53c214 --- /dev/null +++ b/restic-install.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +v="$1" +url="https://github.com/restic/restic/releases/download/v${v}/" +file="restic_${v}_linux_amd64" +pack="${file}.bz2" + +wget -O /tmp/${pack} "${url}${pack}" +wget -O /tmp/resticsha256 "${url}SHA256SUMS" +wget -O /tmp/resticsha256.asc "${url}SHA256SUMS.asc" + +(cd /tmp/; sha256sum --ignore-missing --check /tmp/resticsha256) +(cd /tmp/; bunzip2 ${pack}) +mv /tmp/${file} /usr/local/bin/restic +chmod +x /usr/local/bin/restic + +