fix #892 (trailing dot in supplied hostname)

... and do minor updates to do bash internal functions in ``parse_hn_port()``
This commit is contained in:
Dirk 2017-11-05 22:41:11 +01:00
parent 000f957646
commit 5bd8cb08ba

View File

@ -13209,11 +13209,9 @@ parse_hn_port() {
local tmp_port
NODE="$1"
# strip "https" and trailing urlpath supposed it was supplied additionally
grep -q 'https://' <<< "$NODE" && NODE=$(sed -e 's/^https\:\/\///' <<< "$NODE")
# strip trailing urlpath
NODE=$(sed -e 's/\/.*$//' <<< "$NODE")
NODE="${NODE/https\:\/\//}" # strip "https"
NODE="${NODE%%/*}" # strip trailing urlpath
NODE="${NODE%%.}" # strip trailing "." if supplied
# if there's a trailing ':' probably a starttls/application protocol was specified
if grep -q ':$' <<< "$NODE"; then