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