raspiblitz/home.admin/96removeTorService.sh

57 lines
1.4 KiB
Bash
Raw Normal View History

2018-08-29 16:41:35 +02:00
#!/bin/bash
# load network
network=`cat .network`
# location of TOR config
torrc="/etc/tor/torrc"
echo "*** Stopping all Services ***"
sudo systemctl stop lnd
sudo systemctl stop ${network}d
sudo systemctl stop tor@default
echo ""
echo "*** Disable TOR service ***"
sudo systemctl disable tor@default
echo ""
echo "*** Changing ${network} Config ***"
2018-08-29 17:11:55 +02:00
sudo cat /home/bitcoin/.${network}/${network}.conf | grep -Ev 'onlynet=onion|.onion' | sudo tee /home/bitcoin/.${network}/${network}.conf
2018-08-29 16:41:35 +02:00
sudo cp /home/bitcoin/.${network}/${network}.conf /home/admin/.${network}/${network}.conf
sudo chown admin:admin /home/admin/.${network}/${network}.conf
echo "*** Removing TOR from LND ***"
sudo systemctl disable lnd
sed -i "5s/.*/Wants=${network}d.service/" ./assets/lnd.service
sed -i "6s/.*/After=${network}d.service/" ./assets/lnd.service
sudo cp /home/admin/assets/lnd.service /etc/systemd/system/lnd.service
sudo chmod +x /etc/systemd/system/lnd.service
sudo systemctl enable lnd
echo "OK"
echo ""
echo "*** Remove Tor ***"
2018-08-29 17:11:55 +02:00
sudo apt remove tor tor-arm -y
2018-08-29 16:41:35 +02:00
echo ""
echo "*** Remove dirmngr ***"
2018-08-29 17:11:55 +02:00
sudo apt remove dirmngr
2018-08-29 16:41:35 +02:00
echo ""
echo "*** Remove NYX ***"
2018-08-29 17:11:55 +02:00
sudo pip uninstall nyx -y
2018-08-29 16:41:35 +02:00
echo ""
echo "*** Remove TOR Files/Config ***"
sudo rm -r -f /mnt/hdd/tor
echo ""
echo "*** Finshing Setup / REBOOT ***"
echo "OK - all should be set"
echo ""
echo "PRESS ENTER ... to REBOOT"
read key
sudo shutdown -r now
exit 0