diff --git a/docker/phantun.sh b/docker/phantun.sh index 1949d23..46f4300 100755 --- a/docker/phantun.sh +++ b/docker/phantun.sh @@ -77,7 +77,8 @@ _get_peer6_from_args() { } _get_port_from_args() { - echo "$@" | awk -F '-l|--local' '{print $2}' | awk '{print $1}' + local value=$(echo "$@" | awk -F '-l|--local' '{print $2}' | awk '{print $1}') + _is_server_mode "$1" && echo $value || echo $value | awk -F ':' '{print $2}' } _stop_process() {