Skip to content

Commit 0637a89

Browse files
committed
check Tor on first start
1 parent d0a0e76 commit 0637a89

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

scripts/start.joininbox.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ if [ "$setupStep" -lt 100 ];then
4242
fi
4343
echo "# cpu=${cpu}"
4444

45+
# check Tor
46+
torEntry=$(grep -c "runBehindTor" < /home/joinmarket/joinin.conf)
47+
if [ "$torEntry" -eq 0 ];then
48+
torTest=$(curl --socks5 localhost:9050 --socks5-hostname localhost:9050 -s \
49+
https://check.torproject.org/ | cat | grep -m 1 Congratulations | xargs)
50+
if [ "$torTest" = "Congratulations. This browser is configured to use Tor." ]
51+
then
52+
runBehindTor=on
53+
else
54+
runBehindTor=off
55+
fi
56+
echo "runBehindTor=$runBehindTor" >> /home/joinmarket/joinin.conf
57+
echo "# runBehindTor=$runBehindTor"
58+
fi
59+
4560
# make sure Tor path is known
4661
DirEntry=$(grep -c "HiddenServiceDir" < /home/joinmarket/joinin.conf)
4762
if [ "$DirEntry" -eq 0 ];then

0 commit comments

Comments
 (0)