File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,15 @@ set -euo pipefail # Treat unset variables as an error
26
26
_non_tor=" 192.168.1.0/24 192.168.0.0/24"
27
27
28
28
# ## get the container tor runs in
29
- _tor_container=$( docker ps | awk ' /torproxy/ {print $NF; quit}' )
29
+ _tor_container=" $( docker ps | awk ' /torproxy/ {print $NF; quit}' ) "
30
30
if [[ " $_tor_container " == " " ]]; then
31
31
echo ' ERROR: you must start a tor proxy container first, IE:'
32
32
echo ' docker run -d --net host --restart always dperson/torproxy'
33
33
exit 1
34
34
fi
35
35
36
36
# ## get the UID that tor runs as
37
- _tor_uid=$( docker exec $_tor_container id -u tor)
37
+ _tor_uid=" $( docker exec $_tor_container id -u tor) "
38
38
39
39
# ## Tor's TransPort
40
40
_trans_port=" 9040"
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ password() { local passwd="$1" file=/etc/tor/torrc
73
73
# Arguments:
74
74
# none)
75
75
# Return: Help text
76
- usage () { local RC=${1:- 0}
76
+ usage () { local RC=" ${1:- 0} "
77
77
echo " Usage: ${0##*/ } [-opt] [command]
78
78
Options (fields in '[]' are optional, '<>' are required):
79
79
-h This help
@@ -117,10 +117,10 @@ shift $(( OPTIND - 1 ))
117
117
[[ " ${USERID:- " " } " =~ ^[0-9]+$ ]] && usermod -u $USERID -o tor
118
118
[[ " ${GROUPID:- " " } " =~ ^[0-9]+$ ]] && groupmod -g $GROUPID -o tor
119
119
for env in $( printenv | grep ' ^TOR_' ) ; do
120
- name=$( cut -c4- <<< ${env%% =* } )
120
+ name=" $( cut -c4- <<< ${env%% =* } ) "
121
121
val=" \" ${env##* =} \" "
122
122
[[ " $name " =~ _ ]] && continue
123
- [[ " $val " =~ ^\" ([0-9]+| false| true)\" $ ]] && val=$( sed ' s|"||g' <<< $val )
123
+ [[ " $val " =~ ^\" ([0-9]+| false| true)\" $ ]] && val=" $( sed ' s|"||g' <<< $val ) "
124
124
if grep -q " ^$name " /etc/tor/torrc; then
125
125
sed -i " /^$name /s| .*| $val |" /etc/tor/torrc
126
126
else
You can’t perform that action at this time.
0 commit comments