mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-26 19:47:05 +02:00
#592 prevent TOR sources multiple times & buster
This commit is contained in:
@@ -51,19 +51,33 @@ prepareTorSources()
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "*** Adding KEYS deb.torproject.org ***"
|
echo "*** Adding KEYS deb.torproject.org ***"
|
||||||
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo gpg --import
|
torKeyAvailable=$(sudo gpg --list-keys | grep -c "A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89")
|
||||||
sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
|
echo "torKeyAvailable=${torKeyAvailable}"
|
||||||
|
if [ ${torKeyAvailable} -eq 0 ]; then
|
||||||
|
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo gpg --import
|
||||||
|
sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "TOR key is available"
|
||||||
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "*** Adding Tor Sources to sources.list ***"
|
echo "*** Adding Tor Sources to sources.list ***"
|
||||||
if [ "${baseImage}" = "raspbian" ] || [ "${baseImage}" = "armbian" ] || [ "${baseImage}" = "dietpi" ]; then
|
torSourceListAvailable=$(sudo cat /etc/apt/sources.list | grep -c 'https://deb.torproject.org/torproject.org')
|
||||||
echo "deb https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list
|
echo "torSourceListAvailable=${torSourceListAvailable}"
|
||||||
echo "deb-src https://deb.torproject.org/torproject.org stretch main" | sudo tee -a /etc/apt/sources.list
|
if [ ${torSourceListAvailable} -eq 0 ]; then
|
||||||
elif [ "${baseImage}" = "ubuntu" ]; then
|
echo "Adding TOR sources ..."
|
||||||
echo "deb https://deb.torproject.org/torproject.org bionic main" | sudo tee -a /etc/apt/sources.list
|
if [ "${baseImage}" = "raspbian" ] || [ "${baseImage}" = "armbian" ] || [ "${baseImage}" = "dietpi" ]; then
|
||||||
echo "deb-src https://deb.torproject.org/torproject.org bionic main" | sudo tee -a /etc/apt/sources.list
|
echo "deb https://deb.torproject.org/torproject.org buster main" | sudo tee -a /etc/apt/sources.list
|
||||||
|
echo "deb-src https://deb.torproject.org/torproject.org buster main" | sudo tee -a /etc/apt/sources.list
|
||||||
|
elif [ "${baseImage}" = "ubuntu" ]; then
|
||||||
|
echo "deb https://deb.torproject.org/torproject.org bionic main" | sudo tee -a /etc/apt/sources.list
|
||||||
|
echo "deb-src https://deb.torproject.org/torproject.org bionic main" | sudo tee -a /etc/apt/sources.list
|
||||||
|
fi
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "TOR sources are available"
|
||||||
fi
|
fi
|
||||||
echo "OK"
|
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user