-
Notifications
You must be signed in to change notification settings - Fork 19
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
Update tor_public_pool.sh #154
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
function enable_tor_public_pool { | ||
if [[ $OS == Mac ]] ; then no_mac ; return 1 ; fi | ||
if [[ $OS == Mac ]]; then no_mac; return 1; fi | ||
|
||
enable_tor_general || return 1 | ||
enable_tor_general || return 1 | ||
|
||
if sudo grep "HiddenServiceDir $varlibtor/public_pool-service/" \ | ||
$torrc | grep -v "^#" >$dn 2>&1 ; then true ; debug "true" ; else debug "else" | ||
echo "HiddenServiceDir $varlibtor/public_pool-service/" | sudo tee -a $torrc >$dn 2>&1 | ||
if sudo grep "HiddenServiceDir $varlibtor/public_pool-service/" $torrc | grep -v "^#" >$dn 2>&1; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, the original was ugly and uncalled for. |
||
true | ||
debug "true" | ||
else | ||
debug "else" | ||
echo "HiddenServiceDir $varlibtor/public_pool-service/" | sudo tee -a $torrc >$dn 2>&1 | ||
fi | ||
|
||
if sudo grep "HiddenServicePort 5055 127.0.0.1:5052" \ | ||
$torrc | grep -v "^#" >$dn 2>&1 ; then true ; else | ||
echo "HiddenServicePort 5055 127.0.0.1:5052" | sudo tee -a $torrc >$dn 2>&1 | ||
if sudo grep "HiddenServicePort 5055 127.0.0.1:5052" $torrc | grep -v "^#" >$dn 2>&1; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that I look, it's probably better to have no else and put the code under "then" by adding a "!" before sudo |
||
true | ||
else | ||
echo "HiddenServicePort 5055 127.0.0.1:5052" | sudo tee -a $torrc >$dn 2>&1 | ||
fi | ||
|
||
restart_tor | ||
restart_tor | ||
|
||
get_onion_address_variable "public_pool" | ||
get_onion_address_variable "public_pool" | ||
|
||
set_terminal ; echo -e " | ||
set_terminal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. set_terminal ; echo -e " |
||
echo -e " | ||
######################################################################################## | ||
FYI, changes have been made to torrc file, and Tor has been restarted. | ||
######################################################################################## | ||
" | ||
enter_continue ; jump $enter_cont | ||
enter_continue | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commonly used style, and helps the search if I want to refactor, looking for this specific line |
||
jump $enter_cont | ||
} | ||
|
||
function disable_tor_public_pool { | ||
|
||
sudo gsed -i "/public_pool/d" $torrc | ||
sudo gsed -i "/127.0.0.1:5052/d" $torrc | ||
restart_tor | ||
success "Public Pool Tor" "being disabled" | ||
} | ||
sudo gsed -i "/public_pool/d" $torrc | ||
sudo gsed -i "/127.0.0.1:5052/d" $torrc | ||
restart_tor | ||
success "Public Pool Tor" "being disabled" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind much either way, but I use spaces before every ; all through Parmanode.
If I'm going to use C or C++, I don't use the space.