autorestic/install.sh
2019-11-27 19:30:01 +01:00

22 lines
434 B
Bash
Executable File

#!/bin/bash
OUT_FILE=/usr/local/bin/autorestic
if [[ "$OSTYPE" == "linux-gnu" ]]; then
TYPE=linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
TYPE=macos
else
echo "Unsupported OS"
exit
fi
curl -s https://api.github.com/repos/cupcakearmy/autorestic/releases/latest \
| grep "browser_download_url.*_${TYPE}" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O ${OUT_FILE} -i -
chmod +x ${OUT_FILE}
autorestic install
autorestic