Skip to content

Instantly share code, notes, and snippets.

@basilmusa
Created October 24, 2021 18:39
Show Gist options
  • Select an option

  • Save basilmusa/37ec89ab360e9aa9500f632fa8df0772 to your computer and use it in GitHub Desktop.

Select an option

Save basilmusa/37ec89ab360e9aa9500f632fa8df0772 to your computer and use it in GitHub Desktop.

Revisions

  1. basilmusa created this gist Oct 24, 2021.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/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