-
-
Save mrahtz/d42dd09a30f4f3776f435d72c9f59ead to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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