Skip to content

Instantly share code, notes, and snippets.

@basilmusa
Created October 24, 2021 18:39
Show Gist options
  • Save basilmusa/37ec89ab360e9aa9500f632fa8df0772 to your computer and use it in GitHub Desktop.
Save basilmusa/37ec89ab360e9aa9500f632fa8df0772 to your computer and use it in GitHub Desktop.
Install Restic
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "*** This script must be run as root ***"
exit 1
fi
if hash restic 2>/dev/null; then
echo "*** restic is already installed ***";
restic version
exit 0;
fi
cd /usr/local/bin
wget https://github.com/restic/restic/releases/download/v0.12.1/restic_0.12.1_linux_amd64.bz2 -q -O restic.bz2
bunzip2 restic.bz2
chmod +x restic
restic generate --bash-completion /etc/bash_completion.d/restic
cd $OLDPWD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment