Created
January 23, 2020 14:34
-
-
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
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 | |
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