Subversion Repositories vgwhois

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
11 daniel-mar 1
#!/bin/bash
2
 
3
#
4
#  VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
5
#  Maintenance / Developer utilities
6
#
7
#  (c) 2012-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
8
#
9
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
10
#
11
 
12
# TODO: $@ or $* ?
13
 
14
DIR=$( dirname "$0" )
15
 
16
. "$DIR/../../config/testcases.conf"
17
 
18
GWI_EXEC="$DIR"/../../../main/vgwhois
19
 
20
if [ $trytor -eq 1 ]; then
21
	if [ -e "/usr/bin/vtor" ]; then
22
		# We use vtor first, because it needs to cleanup temp files, which is only possible if it is not killed... Does this work?
23
		vtor -a -r 1 -- "$DIR"/timeout.sh -t 10 -- "$GWI_EXEC" $@
24
	elif [ -e "/usr/bin/usewithtor" ]; then
25
		"$DIR"/timeout.sh -t 10 -- usewithtor "$GWI_EXEC" $@
26
	elif [ -e "/usr/bin/torify" ]; then
27
		"$DIR"/timeout.sh -t 10 -- torify "$GWI_EXEC" $@
28
	else
29
		echo "Warning: Cannot find any TOR proxy software. Will do the query without TOR." >&2
30
		"$DIR"/timeout.sh -t 10 -- "$GWI_EXEC" $@
31
	fi
32
else
33
	"$DIR"/timeout.sh -t 10 -- "$GWI_EXEC" $@
34
fi