diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 index 06be4be..0ef2695 --- a/install.sh +++ b/install.sh @@ -1,9 +1,21 @@ #!/bin/sh + OUT_FILE=/usr/local/bin/autorestic +if [[ "$OSTYPE" == "linux-gnu" ]]; then + TYPE=linux +elif [[ "$OSTYPE" == "darwin"* ]]; then + TYPE=macos +else + echo "Unsupported OS" + exit +fi + curl -s https://api.github.com/repos/cupcakearmy/autorestic/releases/latest \ -| grep "browser_download_url.*-macos" \ +| grep "browser_download_url.*_${TYPE}" \ | cut -d : -f 2,3 \ | tr -d \" \ -| wget -q -O $OUT_FILE -i - -chmod +x $OUT_FILE \ No newline at end of file +| wget -O ${OUT_FILE} -i - +chmod +x ${OUT_FILE} + +autorestic \ No newline at end of file