tor-hs: tor-hs.init handle_hs_ports_conf split ports
Using substring instead of awk. It changes behaviour when only one port is specified. Previously: value="80" => public="80" local="" Now: value="80" => public="80" local="80" It simplifies configuration of one-to-one ports. Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
This commit is contained in:
parent
910041d39f
commit
c709e7a09f
|
@ -43,8 +43,8 @@ handle_hs_ports_conf() {
|
|||
local value="$1"
|
||||
local ipv4="$2"
|
||||
|
||||
public_port=$(echo "$value"|awk -F';' '{print $1}')
|
||||
local_port=$(echo "$value"|awk -F';' '{print $2}')
|
||||
public_port="${value#*;}"
|
||||
local_port="${value%;*}"
|
||||
echo "HiddenServicePort $public_port $ipv4:$local_port">>$TORRC_FILE
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue