Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ngrok http --log=stdout https://localhost:6901 > /dev/null &
- #!/bin/sh
- # Set local port from command line arg or default to 8443
- LOCAL_PORT=${1-8443}
- echo "Start ngrok in background on port [ $LOCAL_PORT ]"
- nohup ngrok http "$LOCAL_PORT" &>/dev/null &
- echo -n "Extracting ngrok public url ."
- NGROK_PUBLIC_URL=""
- while [ -z "$NGROK_PUBLIC_URL" ]; do
- # Run 'curl' against ngrok API and extract public (using 'sed' command)
- export NGROK_PUBLIC_URL=$(curl --silent --max-time 10 --connect-timeout 5 \
- --show-error http://127.0.0.1:4040/api/tunnels | \
- sed -nE 's/.*public_url":"(https:..[^"]*).*/\1/p')
- sleep 1
- echo -n "."
- done
- echo
- echo "NGROK_PUBLIC_URL => [ $NGROK_PUBLIC_URL ]"
- echo $NGROK_PUBLIC_URL > /home/ubuntu/docker/telegram_bot_link.secret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement