Allow configuring local forwarded host

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-04-07 00:01:29 +02:00
parent 9b5933efcd
commit 0d0e9e83cb
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -12,14 +12,18 @@ shareport=$(which -a shareport | grep -v $0 | head -n1)
# Start argument array # Start argument array
args=($shareport) args=($shareport)
host=localhost
# Parse options # Parse options
while getopts ":hp:v" o; do while getopts ":hi:p:v" o; do
case "${o}" in case "${o}" in
h) h)
usage usage
exit 0 exit 0
;; ;;
i)
host="${OPTARG}"
;;
p) p)
args+=(--var "FQDN_PREFIX=${OPTARG}") args+=(--var "FQDN_PREFIX=${OPTARG}")
;; ;;
@ -37,7 +41,7 @@ shift $((OPTIND - 1))
# Add port # Add port
port="${1:-}" port="${1:-}"
[[ -n $port ]] || fatal "Missing local port as first argument" [[ -n $port ]] || fatal "Missing local port as first argument"
args+=(--local-addr "localhost:${port}") args+=(--local-addr "${host}:${port}")
step "Fetching secrets..." step "Fetching secrets..."
export IDENTITY_FILE=$(mktemp) export IDENTITY_FILE=$(mktemp)