allow Tor update before setup (#1775)

This commit is contained in:
Christian Rotzoll 2020-11-16 16:29:08 +01:00 committed by rootzoll
parent faf53dbc94
commit 375c818f37
2 changed files with 9 additions and 8 deletions

View file

@ -232,7 +232,7 @@ fi
# TOR
if [ "${runBehindTor}" = "on" ]; then
echo "Provisioning TOR - run config script" >> ${logFile}
sudo sed -i "s/^message=.*/message='Setup TOR (takes time)'/g" ${infoFile}
sudo sed -i "s/^message=.*/message='Setup Tor (takes time)'/g" ${infoFile}
sudo /home/admin/config.scripts/internet.tor.sh on >> ${logFile} 2>&1
else
echo "Provisioning TOR - keep default" >> ${logFile}

View file

@ -7,7 +7,7 @@
# command info
if [ $# -eq 0 ] || [ "$1" = "-h" ] || [ "$1" = "-help" ]; then
echo "small config script to switch TOR on or off"
echo "script to switch TOR on or off"
echo "internet.tor.sh [status|on|off|prepare|btcconf-on|btcconf-off|lndconf-on|update]"
exit 1
fi
@ -44,6 +44,7 @@ fi
# function: install keys & sources
prepareTorSources()
{
# Prepare for TOR service
echo "*** INSTALL TOR REPO ***"
echo ""
@ -193,12 +194,6 @@ if [ -f "/mnt/hdd/raspiblitz.conf" ]; then
source /mnt/hdd/raspiblitz.conf
fi
# make sure the network was set (by sourcing raspiblitz.conf)
if [ ${#network} -eq 0 ]; then
echo "FAIL - unknwon network due to missing /mnt/hdd/raspiblitz.conf"
exit 1
fi
# if started with status
if [ "$1" = "status" ]; then
# is Tor activated
@ -251,6 +246,12 @@ fi
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
echo "switching the TOR ON"
# make sure the network was set (by sourcing raspiblitz.conf)
if [ ${#network} -eq 0 ]; then
echo "FAIL - unknwon network due to missing /mnt/hdd/raspiblitz.conf"
exit 1
fi
# setting value in raspi blitz config
sudo sed -i "s/^runBehindTor=.*/runBehindTor=on/g" /mnt/hdd/raspiblitz.conf