Subversion Repositories vgwhois

Compare Revisions

Regard whitespace Rev 11 → Rev 10

/trunk/maintenance/qa-monitor/testcases/single
1,7 → 1,7
#!/bin/bash
 
#
# VGWhoIs (ViaThinkSoft Global WhoIs, a fork of generic Whois / gwhois)
# VWhois (ViaThinkSoft WHOIS, a fork of generic Whois / gwhois)
# Maintenance / Developer utilities
#
# (c) 2012-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de>
163,7 → 163,7
function question2 {
while true; do
echo ""
echo "vgwhois might already have been fixed. Do you want to enforce a vgwhois recheck now? ([y]es, [n]o, e[x]it)"
echo "Gwhois might already have been fixed. Do you want to enforce a gwhois recheck now? ([y]es, [n]o, e[x]it)"
read yn
case $yn in
[YyRr]* )
217,7 → 217,7
return 0
fi
else
T=$( mktemp --suffix='.vgwhoisTC' )
T=$( mktemp --suffix='.gwhoisTC' )
 
# In interactive/background mode, we will always do a webrequest when there is no problem and no expectation file without respect of the last checktime, to avoid that the status monitor will show entries with "no expectation file" when the user pressed "no", and then he would have to wait 7 days until "batch u" works again.
# TODO: how to do that in 1 line?
237,16 → 237,16
fi
fi
if [ $CALL_GWI -eq 1 ]; then
echo "... calling vgwhois ..."
# We have to use loc_vgwhois to allow $trytor to work correctly.
echo "... calling gwhois ..."
# We have to use loc_gwhois to allow $trytor to work correctly.
# The torifiers "torify" and "usewithtor" always outputting bogus "libtorsocks" warning messages which would be saved in the output
# "vtor" - if applied to this script - can only filter them from STDOUT and STDERR, but not intercept this "&>" pipe
# So we have to use this loc_vgwhois script, where we torify manually
# So we have to use this loc_gwhois script, where we torify manually
# Also, it is important that we do the warning message filtering in this step, because in the final output the lines will be colored/highlighted, and therefore "vtor" cannot grep them correctly anymore.
# Note: regex only valid in the years 1000-1099, 1900-2099, 2900-2999
# grep away volative stuff like server names or times
(
"$DIR"/loc_vgwhois "$query" \
"$DIR"/loc_gwhois "$query" \
| grep -v "This query was served by " \
| grep -v "(c)[12][90][0-9]\{2\}" \
| grep -v "[12][90][0-9]\{2\}-[0-9]\{2\}-[0-9]\{2\}" \
269,7 → 269,7
# rm "$Q"
# fi
 
# behoben? in mode=i and mode=u, should the output of a new vgwhois request be saved into the problem file, if the user cancels? (to avoid a second web request?)
# behoben? in mode=i and mode=u, should the output of a new gwhois request be saved into the problem file, if the user cancels? (to avoid a second web request?)
# also, when doing a recheck after a perl error, and then cancel, the problem-file will not be updated!
# TODO: was ist besser?
#if [ ! -f "$Q" ] && [ "$T" != "$Q" ]; then
299,13 → 299,13
WARNINGS=()
cat "$T" | grep -E "at /(bin|usr|etc|var)/\S+ line" > /dev/null
if [ $? -eq 0 ]; then
WARNINGS+=("Perl errors found in vgwhois output!")
WARNINGS+=("Perl errors found in gwhois output!")
fi
cat "$T" | head -n 1 | grep -E "^("$'\xEF\xBB\xBF'"){0,1}Process query: '$query'" > /dev/null
if [ $? -ne 0 ]; then
WARNINGS+=("The vgwhois output does not begin with 'Process query'!")
WARNINGS+=("The gwhois output does not begin with 'Process query'!")
fi
cat "$T" | grep "vgwhois remarks: If this is a valid domainname or handle, please file a bug report." > /dev/null
cat "$T" | grep "gwhois remarks: If this is a valid domainname or handle, please file a bug report." > /dev/null
if [ $? -eq 0 ]; then
WARNINGS+=("No pattern match!")
fi
385,7 → 385,7
else
# resetconsole
echo "This query has no expected state. Please define one."
echo "This is the current output of vgwhois:"
echo "This is the current output of gwhois:"
 
echo ""
cat "$T" | showPatternHighlighted
446,7 → 446,7
echo " -r|--rechecktime seconds"
echo " Default: $recheck_time = approx. $hf_recheck_time)"
echo " -f|--force"
echo " Ignores --rechecktime and forces a new vgwhois request"
echo " Ignores --rechecktime and forces a new gwhois request"
echo " Default: $force"
}