Rev 4 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | #!/bin/bash |
2 | |||
3 | # |
||
5 | daniel-mar | 4 | # VWhois (ViaThinkSoft WHOIS, a fork of generic Whois / gwhois) |
5 | # Maintenance / Developer utilities |
||
2 | daniel-mar | 6 | # |
5 | daniel-mar | 7 | # (c) 2012-2019 by Daniel Marschall, ViaThinkSoft <info@daniel-marschall.de> |
2 | daniel-mar | 8 | # |
5 | daniel-mar | 9 | # License: https://www.gnu.org/licenses/gpl-2.0.html (GPL version 2) |
2 | daniel-mar | 10 | # |
11 | |||
12 | DIR=$( dirname "$0" ) |
||
13 | |||
14 | . "$DIR/../../config/testcases.conf" |
||
15 | |||
4 | daniel-mar | 16 | CACHE_DIR="$DIR/../../.cache" |
17 | TESTCASES_LIST="$DIR/../../config/testcases.list" |
||
18 | |||
2 | daniel-mar | 19 | count=0 |
20 | |||
21 | while read f; do |
||
22 | if [ -z "$f" ]; then |
||
23 | continue; |
||
24 | fi |
||
25 | |||
26 | echo "$f" | grep -E "\s*^#" > /dev/null |
||
27 | if [ $? -eq 0 ]; then |
||
28 | continue; |
||
29 | fi |
||
30 | |||
31 | # Warum? "tld jp" wird dann zu "tld" |
||
32 | # query="$( basename $f )" |
||
33 | query="$f"; |
||
34 | |||
4 | daniel-mar | 35 | if [ ! -d "$CACHE_DIR/testcases/checktimestamps" ]; then |
36 | mkdir -p "$CACHE_DIR/testcases/checktimestamps" |
||
3 | daniel-mar | 37 | fi |
4 | daniel-mar | 38 | tsfile="$CACHE_DIR/testcases/checktimestamps/$query" |
3 | daniel-mar | 39 | |
4 | daniel-mar | 40 | if [ ! -d "$CACHE_DIR/testcases/problems" ]; then |
41 | mkdir -p "$CACHE_DIR/testcases/problems" |
||
3 | daniel-mar | 42 | fi |
4 | daniel-mar | 43 | errfile="$CACHE_DIR/testcases/problems/$query" |
2 | daniel-mar | 44 | |
45 | if [ ! -f "$tsfile" ]; then |
||
46 | ((count++)); |
||
47 | elif [ ! -f "$tsfile" ] || [ $( stat --format=%Y "$tsfile" ) -le $(( $( date +%s ) - $recheck_time )) ]; then |
||
48 | ((count++)); |
||
49 | elif [ -f "$errfile" ]; then |
||
50 | ((count++)); |
||
51 | fi |
||
52 | |||
4 | daniel-mar | 53 | done < "$TESTCASES_LIST" |
2 | daniel-mar | 54 | |
55 | if [ $count -eq 0 ]; then |
||
56 | echo "[ OK ]" |
||
57 | exit 0 |
||
58 | else |
||
59 | echo "[ !! ] $count testcases require attention" |
||
60 | exit 1 |
||
61 | fi |