install_restic_for_tests.sh 483 Bytes
Newer Older
ale's avatar
ale committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

RESTIC_VERSION=${1:-0.9.1}
case `dpkg-architecture -qDEB_BUILD_ARCH` in
amd64)   ARCH=amd64   ;;
i686)    ARCH=386     ;;
armel)   ARCH=arm     ;;
armhf)   ARCH=arm64   ;;
*)
    echo "Unsupported architecture!" >&2
    exit 1
    ;;
esac

DOWNLOAD_URL="https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_${ARCH}.bz2"

set -e

wget -O- -nv "${DOWNLOAD_URL}" | bunzip2 -c > /usr/bin/restic
chmod +x /usr/bin/restic

exit 0