2019-06-20 23:54:23 +02:00
|
|
|
#!/bin/sh
|
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}
|
|
|
|
|
|
|
|
autorestic
|