install_restic_for_tests.sh 487 Bytes
Newer Older
1 2 3
#!/bin/sh

RESTIC_VERSION=${1:-0.9.1}
ale's avatar
ale committed
4

5 6 7 8 9 10 11 12 13 14 15 16 17 18
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
ale's avatar
ale committed
19
set -x
20

ale's avatar
ale committed
21
curl -sL "${DOWNLOAD_URL}" | bunzip2 -c > /usr/bin/restic
22 23 24
chmod +x /usr/bin/restic

exit 0