mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2024-12-22 08:16:25 +00:00
install script
This commit is contained in:
parent
33be94ba55
commit
7b7eec2dba
31
install.sh
31
install.sh
@ -1,21 +1,38 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
shopt -s nocaseglob
|
||||||
|
|
||||||
OUT_FILE=/usr/local/bin/autorestic
|
OUT_FILE=/usr/local/bin/autorestic
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "linux-gnu" ]]; then
|
# Type
|
||||||
TYPE=linux
|
NATIVE_OS=$(uname | tr '[:upper:]' '[:lower:]')
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
if [[ $NATIVE_OS == *"linux"* ]]; then
|
||||||
TYPE=macos
|
OS=linux
|
||||||
|
elif [[ $NATIVE_OS == *"darwin"* ]]; then
|
||||||
|
OS=darwin
|
||||||
else
|
else
|
||||||
echo "Unsupported OS"
|
echo "Could not determine OS automatically, please check the release page manually: https://github.com/cupcakearmy/autorestic/releases"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo $OS
|
||||||
|
|
||||||
|
NATIVE_ARCH=$(uname -m)
|
||||||
|
if [[ $NATIVE_ARCH == *"x86_64"* ]]; then
|
||||||
|
ARCH=amd64
|
||||||
|
elif [[ $NATIVE_ARCH == *"x86"* ]]; then
|
||||||
|
ARCH=386
|
||||||
|
else
|
||||||
|
echo "Could not determine Architecure automatically, please check the release page manually: https://github.com/cupcakearmy/autorestic/releases"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo $ARCH
|
||||||
|
|
||||||
curl -s https://api.github.com/repos/cupcakearmy/autorestic/releases/latest \
|
curl -s https://api.github.com/repos/cupcakearmy/autorestic/releases/latest \
|
||||||
| grep "browser_download_url.*_${TYPE}" \
|
| grep "browser_download_url.*_${OS}_${ARCH}" \
|
||||||
| cut -d : -f 2,3 \
|
| cut -d : -f 2,3 \
|
||||||
| tr -d \" \
|
| tr -d \" \
|
||||||
| wget -O ${OUT_FILE} -i -
|
| wget -O "${OUT_FILE}.bz2" -i -
|
||||||
|
bzip2 -fd "${OUT_FILE}.bz2"
|
||||||
chmod +x ${OUT_FILE}
|
chmod +x ${OUT_FILE}
|
||||||
|
|
||||||
autorestic install
|
autorestic install
|
||||||
|
Loading…
Reference in New Issue
Block a user