mirror of
https://github.com/openwrt/packages.git
synced 2026-12-05 11:05:37 +04:00
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:
1 parent
910041d39f
commit
c709e7a09f
1 file changed
+2
-2
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user