mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-08 20:09:03 +02:00
Tor from source (#1769)
This commit is contained in:
@@ -297,6 +297,9 @@ fi
|
|||||||
if [ "${pyblock}" == "on" ]; then
|
if [ "${pyblock}" == "on" ]; then
|
||||||
OPTIONS+=(PYBLOCK "Update PyBLOCK")
|
OPTIONS+=(PYBLOCK "Update PyBLOCK")
|
||||||
fi
|
fi
|
||||||
|
if [ "${runBehindTor}" == "on" ]; then
|
||||||
|
OPTIONS+=(TOR "Update Tor from the source code")
|
||||||
|
fi
|
||||||
|
|
||||||
CHOICE=$(whiptail --clear --title "Update Options" --menu "" 13 55 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
|
CHOICE=$(whiptail --clear --title "Update Options" --menu "" 13 55 6 "${OPTIONS[@]}" 2>&1 >/dev/tty)
|
||||||
|
|
||||||
@@ -327,4 +330,10 @@ case $CHOICE in
|
|||||||
PYBLOCK)
|
PYBLOCK)
|
||||||
/home/admin/config.scripts/bonus.pyblock.sh update
|
/home/admin/config.scripts/bonus.pyblock.sh update
|
||||||
;;
|
;;
|
||||||
|
POOL)
|
||||||
|
/home/admin/config.scripts/bonus.pool.sh update
|
||||||
|
;;
|
||||||
|
TOR)
|
||||||
|
sudo /home/admin/config.scripts/internet.tor.sh update
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
# command info
|
# command info
|
||||||
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
|
||||||
echo "small config script to switch TOR on or off"
|
echo "small config script to switch TOR on or off"
|
||||||
echo "internet.tor.sh [status|on|off|prepare|btcconf-on|btcconf-off|lndconf-on]"
|
echo "internet.tor.sh [status|on|off|prepare|btcconf-on|btcconf-off|lndconf-on|update]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -239,11 +239,13 @@ fi
|
|||||||
# make sure /etc/tor exists
|
# make sure /etc/tor exists
|
||||||
sudo mkdir /etc/tor 2>/dev/null
|
sudo mkdir /etc/tor 2>/dev/null
|
||||||
|
|
||||||
|
if [ "$1" != "update" ]; then
|
||||||
# stop services (if running)
|
# stop services (if running)
|
||||||
echo "making sure services are not running"
|
echo "making sure services are not running"
|
||||||
sudo systemctl stop lnd 2>/dev/null
|
sudo systemctl stop lnd 2>/dev/null
|
||||||
sudo systemctl stop ${network}d 2>/dev/null
|
sudo systemctl stop ${network}d 2>/dev/null
|
||||||
sudo systemctl stop tor@default 2>/dev/null
|
sudo systemctl stop tor@default 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# switch on
|
# switch on
|
||||||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
@@ -466,6 +468,32 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# update
|
||||||
|
if [ "$1" = "update" ]; then
|
||||||
|
# as in https://2019.www.torproject.org/docs/debian#source
|
||||||
|
prepareTorSources
|
||||||
|
echo "# Install the dependencies"
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y build-essential fakeroot devscripts
|
||||||
|
sudo apt build-dep -y tor deb.torproject.org-keyring
|
||||||
|
rm -rf /home/admin/download/debian-packages
|
||||||
|
mkdir -p /home/admin/download/debian-packages
|
||||||
|
cd /home/admin/download/debian-packages
|
||||||
|
echo "# Building Tor from the source code ..."
|
||||||
|
apt source tor
|
||||||
|
cd tor-*
|
||||||
|
debuild -rfakeroot -uc -us
|
||||||
|
cd ..
|
||||||
|
echo "# Stopping the tor.service before updating"
|
||||||
|
sudo systemctl stop tor
|
||||||
|
echo "# Update ..."
|
||||||
|
sudo dpkg -i tor_*.deb
|
||||||
|
echo "# Starting the tor.service "
|
||||||
|
sudo systemctl start tor
|
||||||
|
echo "# Installed $(tor --version)"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "FAIL - Unknown Parameter $1"
|
echo "FAIL - Unknown Parameter $1"
|
||||||
echo "may needs reboot to run normal again"
|
echo "may needs reboot to run normal again"
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user