Skip to content

Instantly share code, notes, and snippets.

@thatrandomperson5
Last active August 27, 2024 19:29
Show Gist options
  • Save thatrandomperson5/0c49b6c54cf2f52bf63c3bd0874bb960 to your computer and use it in GitHub Desktop.
Save thatrandomperson5/0c49b6c54cf2f52bf63c3bd0874bb960 to your computer and use it in GitHub Desktop.
Termux NGrok installer
echo "Installing NGrok CLI in $PREFIX/bin"
ARCHITECTURE=$(lscpu | grep "Architecture" | tr -d " \t\n\r" | cut -c 14-) # Extract the architecture
URL=""
TAR_LOCATION="$PREFIX/bin/vscode.tar.gz"
if [ "$ARCHITECTURE" = "arm64" ] || [ "$ARCHITECTURE" = "aarch64" ]; then
URL="https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm64.tgz"
elif [ "$ARCHITECTURE" = "arm32" ]; then
URL="https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-arm.tgz"
elif [ "$ARCHITECTURE" = "x64" ] || [ "$ARCHITECTURE" = "x86_64" ] || [ "$ARCHITECTURE" = "amd64" ]; then
URL="https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz"
fi
echo "Downloading $URL"
curl -sSfL "$URL" -o "$TAR_LOCATION"
FILECOUNT=$(tar -tzf "$TAR_LOCATION" | wc -l)
if [ "$FILECOUNT" != "1" ]; then
exit 1
fi
echo "Extracting $TAR_LOCATION"
tar -xzf "$TAR_LOCATION" -C "$PREFIX/bin"
rm "$TAR_LOCATION"
# Run: curl -sSfL https://gist.githubusercontent.com/thatrandomperson5/0c49b6c54cf2f52bf63c3bd0874bb960/raw/install.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment