Skip to content

Instantly share code, notes, and snippets.

View colemilne54's full-sized avatar

Cole Milne colemilne54

View GitHub Profile
@colemilne54
colemilne54 / ngrok-copy
Last active August 9, 2023 02:05 — forked from mlsteele/ngrok-copy
Copy the url of the active ngrok connection to the clipboard.
#!/usr/bin/env bash
# Copy the url of the active ngrok connection to the clipboard.
# Usage:
# ngrok-copy # copies e.g. https://3cd67858.ngrok.io to clipboard.
# ngrok-copy -u # copies e.g. http://3cd67858.ngrok.io to clipboard.
if [[ "$1" == "-u" ]]; then
NGROK_URL=`curl -s http://127.0.0.1:4043/api/tunnels | grep "https://.*.ngrok-free.app" -oh`
else
NGROK_URL=`curl -s http://127.0.0.1:4043/api/tunnels | grep "https://.*.ngrok-free.app" -oh`