autorestic/install.sh

22 lines
434 B
Bash
Raw Normal View History

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