internet.hiddenservice: make fromPort be the 3rd parameter

This commit is contained in:
openoms 2019-12-16 18:15:01 +00:00 committed by GitHub
parent d0fdbdf60b
commit 58da8aedeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# $1 is the service name, same as the HiddenServiceDir in torrc # $1 is the service name, same as the HiddenServiceDir in torrc
# $2 is the port the Hidden Service forwards to (to be used in the Tor browser) # $2 is the port the Hidden Service forwards to (to be used in the Tor browser)
# S3 is the port to be forwarded with the Hidden Service # $3 is the port to be forwarded with the Hidden Service
# command info # command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
@ -24,7 +24,7 @@ if [ ${#toPort} -eq 0 ]; then
exit 1 exit 1
fi fi
fromPort="$2" fromPort="$3"
if [ ${#fromPort} -eq 0 ]; then if [ ${#fromPort} -eq 0 ]; then
echo "ERROR:the port to forward from is missing" echo "ERROR:the port to forward from is missing"
exit 1 exit 1
@ -47,4 +47,4 @@ if [ "${runBehindTor}" = "on" ]; then
fi fi
else else
echo "Tor is not active" echo "Tor is not active"
fi fi