Skip to content

Instantly share code, notes, and snippets.

@mrahtz mrahtz/n.sh
Created Mar 9, 2019

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.