autorestic/install.sh

22 lines
434 B
Bash
Raw Normal View History

2019-11-27 19:30:01 +01:00
#!/bin/bash
2019-06-21 12:22:39 +02:00
2019-06-20 23:54:23 +02:00
OUT_FILE=/usr/local/bin/autorestic
2019-06-21 12:22:39 +02:00
if [[ "$OSTYPE" == "linux-gnu" ]]; then
TYPE=linux
elif [[ "$OSTYPE" == "darwin"* ]]; then
TYPE=macos
else
echo "Unsupported OS"
exit
fi
2019-06-20 23:54:23 +02:00
curl -s https://api.github.com/repos/cupcakearmy/autorestic/releases/latest \
2019-06-21 12:22:39 +02:00
| grep "browser_download_url.*_${TYPE}" \
2019-06-20 23:54:23 +02:00
| cut -d : -f 2,3 \
| tr -d \" \
2019-06-21 12:22:39 +02:00
| wget -O ${OUT_FILE} -i -
chmod +x ${OUT_FILE}
2019-06-21 12:27:59 +02:00
autorestic install
2019-06-21 12:22:39 +02:00
autorestic