cat <<'EXE' | sudo bash
RESTIC_ARCH="$(echo "$(uname -s)_$(dpkg --print-architecture)"|tr '[:upper:]' '[:lower:]')"
RESTIC_HOME="/opt/cli/$(echo "restic-$(uname -s)-$(dpkg --print-architecture)"|tr '[:upper:]' '[:lower:]')"
RESTIC_VERSION=$(curl -s https://api.github.com/repos/restic/restic/releases/latest | grep -Po '"tag_name": "v\K[^"]*')
curl -fsSLo restic.bz2 https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_${RESTIC_ARCH}.bz2
bzip2 -fd restic.bz2 && install restic /usr/local/bin
rm -rf restic.bz2 restic
EXE
which restic
restic version