Skip to content

Instantly share code, notes, and snippets.

@mrahtz
Created March 9, 2019 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrahtz/d42dd09a30f4f3776f435d72c9f59ead to your computer and use it in GitHub Desktop.
Save mrahtz/d42dd09a30f4f3776f435d72c9f59ead to your computer and use it in GitHub Desktop.
#!/bin/bash
pkill -f ngrok
ngrok http $1 &> ~/.ngrok.log &
sleep 1
echo -n 'ngrok http '
json=$(curl -s http://localhost:4040/api/tunnels)
echo "$json" | python3 -c "import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])" || echo $json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment