This file contains hidden or 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
function expose() { | |
if [[ -z "$1" ]]; then | |
echo "Error: No port specified." | |
return 1 # Exit the function with an error status | |
fi | |
local port=$1 | |
ssh -R 80:localhost:${port} [email protected] 2>&1 | awk '/https:\/\/[a-zA-Z0-9]+\.lhr\.life/ {print $NF; fflush(); exit}' | |
} |