Skip to content

Instantly share code, notes, and snippets.

@rorymcdaniel
Created January 23, 2020 14:34
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 rorymcdaniel/0d225f3011928feb81759343cb5bdc66 to your computer and use it in GitHub Desktop.
Save rorymcdaniel/0d225f3011928feb81759343cb5bdc66 to your computer and use it in GitHub Desktop.
Parses information from current Lando container and creates a tunnel using localhost.run
#!/bin/bash
url=`lando info -s appserver_nginx | grep http://localhost`
pattern='([[:digit:]]{5})'
[[ $url =~ $pattern ]]
port=${BASH_REMATCH[1]}
username=`lando info | grep appserver\.\*\.internal -m 1 | grep -oP '(?<=[.])\w+(?=[.])'`
ssh -R 80:localhost:$port $username@ssh.localhost.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment