tor: reload instead of restart

This commit is contained in:
openoms
2021-09-28 17:15:42 +01:00
parent 0d7ac3168a
commit d5a7afc968
4 changed files with 11 additions and 11 deletions

View File

@@ -76,7 +76,7 @@ case $CHOICE in
if [ $(grep -c "peerbloomfilters=1" < /mnt/hdd/bitcoin/bitcoin.conf) -gt 0 ]&&\ if [ $(grep -c "peerbloomfilters=1" < /mnt/hdd/bitcoin/bitcoin.conf) -gt 0 ]&&\
[ $(grep -c Bisq < /etc/tor/torrc) -gt 0 ];then [ $(grep -c Bisq < /etc/tor/torrc) -gt 0 ];then
OPTIONS+=(SHOWBISQ "Show the Hidden Service to connect Bisq") OPTIONS+=(SHOWBISQ "Show the Hidden Service to connect Bisq")
OPTIONS+=(REMOVEBISQ "Remove the Hidden Service for bisq") OPTIONS+=(REMOVEBISQ "Remove the Hidden Service for Bisq")
fi fi
CHOICE=$(dialog --clear \ CHOICE=$(dialog --clear \
--backtitle "" \ --backtitle "" \
@@ -103,12 +103,12 @@ case $CHOICE in
if [ $(grep -c Bisq < /etc/tor/torrc) -eq 0 ];then if [ $(grep -c Bisq < /etc/tor/torrc) -eq 0 ];then
echo "# Creating the Hidden Service for Bisq" echo "# Creating the Hidden Service for Bisq"
echo " echo "
# Hidden Service for Bisq (bitcoin RPC v3) # Hidden Service for Bisq (bitcoin P2P v3)
HiddenServiceDir /mnt/hdd/tor/bisq HiddenServiceDir /mnt/hdd/tor/bisq
HiddenServiceVersion 3 HiddenServiceVersion 3
HiddenServicePort 8333 127.0.0.1:8333" | sudo tee -a /etc/tor/torrc HiddenServicePort 8333 127.0.0.1:8333" | sudo tee -a /etc/tor/torrc
echo "# Restarting Tor" echo "# Reloading Tor"
sudo systemctl restart tor sudo systemctl reload tor@default
sleep 10 sleep 10
TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/bisq/hostname) TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/bisq/hostname)
if [ -z "$TOR_ADDRESS" ]; then if [ -z "$TOR_ADDRESS" ]; then
@@ -135,7 +135,7 @@ HiddenServicePort 8333 127.0.0.1:8333" | sudo tee -a /etc/tor/torrc
REMOVEBISQ) REMOVEBISQ)
sudo sed -i '/Bisq/{N;N;N;d}' /etc/tor/torrc sudo sed -i '/Bisq/{N;N;N;d}' /etc/tor/torrc
echo "# Restarting Tor" echo "# Restarting Tor"
sudo systemctl restart tor;; sudo systemctl reload tor@default;;
SHOWBISQ) SHOWBISQ)
clear clear
TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/bisq/hostname) TOR_ADDRESS=$(sudo cat /mnt/hdd/tor/bisq/hostname)

View File

@@ -143,12 +143,12 @@ case $CHOICE in
if /home/admin/config.scripts/blitz.setconf.sh "/etc/tor/torrc" "debian-tor" if /home/admin/config.scripts/blitz.setconf.sh "/etc/tor/torrc" "debian-tor"
then then
whiptail \ whiptail \
--title "Restart" --yes-button "Restart" --no-button "Not now" \ --title "Reload" --yes-button "Reload" --no-button "Not now" \
--yesno "To apply the new settings Tor needs to restart. --yesno "To apply the new settings need to reload Tor.
Do you want to restart Tor now?" 10 55 Do you want to restart Tor now?" 10 55
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "# Restarting tor" echo "# Restarting tor"
sudo systemctl restart tor@default sudo systemctl reload tor@default
else else
echo "# Continue without restarting." echo "# Continue without restarting."
fi fi

View File

@@ -146,11 +146,11 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo sed -i "s:^CookieAuthFile*:#CookieAuthFile:g" /etc/tor/torrc sudo sed -i "s:^CookieAuthFile*:#CookieAuthFile:g" /etc/tor/torrc
if ! grep -Eq "^CookieAuthentication 1" /etc/tor/torrc; then if ! grep -Eq "^CookieAuthentication 1" /etc/tor/torrc; then
echo "CookieAuthentication 1" | sudo tee -a /etc/tor/torrc echo "CookieAuthentication 1" | sudo tee -a /etc/tor/torrc
sudo systemctl restart tor@default sudo systemctl reload tor@default
fi fi
if ! grep -Eq "^AllowOutboundLocalhost 1" /etc/tor/torsocks.conf; then if ! grep -Eq "^AllowOutboundLocalhost 1" /etc/tor/torsocks.conf; then
echo "AllowOutboundLocalhost 1" | sudo tee -a /etc/tor/torsocks.conf echo "AllowOutboundLocalhost 1" | sudo tee -a /etc/tor/torsocks.conf
sudo systemctl restart tor@default sudo systemctl reload tor@default
fi fi
# joinin.conf settings # joinin.conf settings

View File

@@ -96,7 +96,7 @@ HiddenServicePort $toPort 127.0.0.1:$fromPort" | sudo tee -a /etc/tor/torrc
fi fi
fi fi
# restart tor # reload tor
echo echo
echo "Reloading Tor to activate the Hidden Service..." echo "Reloading Tor to activate the Hidden Service..."
sudo chmod 644 /etc/tor/torrc sudo chmod 644 /etc/tor/torrc