mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 16:26:25 +00:00
22 lines
465 B
Bash
22 lines
465 B
Bash
|
#!/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 1
|
||
|
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
|
||
|
echo "Succefsully installed autorestic"
|