github.com/laof/lite-speed-test@v0.0.0-20230930011949-1f39b7037845/download.sh (about) 1 #!/bin/sh 2 3 DOWNLOAD_URL=$(curl -s https://api.github.com/repos/xxf098/LiteSpeedTest/releases/latest \ 4 | grep browser_download_url \ 5 | grep linux-amd64 \ 6 | grep -v v3- \ 7 | cut -d '"' -f 4) 8 9 test -z "$TMPDIR" && TMPDIR="$(mktemp -d)" 10 11 ( 12 cd "$TMPDIR" 13 echo "Downloading lite from $DOWNLOAD_URL" 14 curl -sL -o lite.gz "$DOWNLOAD_URL" 15 ) 16 17 export TAR_FILE="${TMPDIR}/$(ls $TMPDIR | grep gz)" 18 gzip -d "$TAR_FILE" 19 mv "${TMPDIR}/lite" ./ 20 chmod +x lite