Subversion Repositories vgwhois

Rev

Rev 4 | Go to most recent revision | Blame | Last modification | View Log | RSS feed

#!/bin/bash

#
#  VWhois (ViaThinkSoft WHOIS, a fork of generic Whois / gwhois)
#  Maintenance / Developer utilities
#
#  (c) 2012-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
#
#  License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2)
#

# TODO: $@ or $* ?

DIR=$( dirname "$0" )

. "$DIR/../../config/testcases.conf"

GWI_EXEC="$DIR"/../../../main/gwhois

if [ $trytor -eq 1 ]; then
        if [ -e "/usr/bin/vtor" ]; then
                # We use vtor first, because it needs to cleanup temp files, which is only possible if it is not killed... Does this work?
                vtor -a -r 1 -- "$DIR"/timeout.sh -t 10 -- "$GWI_EXEC" $@
        elif [ -e "/usr/bin/usewithtor" ]; then
                "$DIR"/timeout.sh -t 10 -- usewithtor "$GWI_EXEC" $@
        elif [ -e "/usr/bin/torify" ]; then
                "$DIR"/timeout.sh -t 10 -- torify "$GWI_EXEC" $@
        else
                echo "Warning: Cannot find any TOR proxy software. Will do the query without TOR." >&2
                "$DIR"/timeout.sh -t 10 -- "$GWI_EXEC" $@
        fi
else
        "$DIR"/timeout.sh -t 10 -- "$GWI_EXEC" $@
fi