Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load /etc/tor/torrc as default config #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/CreateTorProcess
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function CreateTorProcess() {
local _arg_uname="$1"
local _arg_socks="$2"
local _arg_control="$3"
local _arg_torrc="$4"

# shellcheck disable=SC2154
local _proc_dir="${_multitor_directory}/${_arg_socks}"
Expand All @@ -34,9 +35,16 @@ function CreateTorProcess() {
# We create a directory for the new tor process.
CreateTorDirectory

# create torrc file
if [[ $var ]]; then
echo "" > "${_torrc_config}"
else
cp "${_arg_torrc}" "${_torrc_config}"
fi

# We save the hash of the password to the configuration file.
# shellcheck disable=SC2154
echo "HashedControlPassword ${_pass_hash}" > "${_torrc_config}"
echo "HashedControlPassword ${_pass_hash}" >> "${_torrc_config}"
_kstate="$?"

if [[ $_kstate -eq 0 ]] ; then
Expand Down
2 changes: 1 addition & 1 deletion src/__init__
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ function __main__() {
"${_FUNCTION_ID}()" \
"socks_port_number: '$socks_port_number', control_port_number: '$control_port_number'"

CreateTorProcess "${user_name}" "${socks_port_number}" "${control_port_number}"
CreateTorProcess "${user_name}" "${socks_port_number}" "${control_port_number}" "/etc/tor/torrc"

# For proxy:
_proxy_ports+=("$socks_port_number")
Expand Down