37d4b7394e15b5fad9272cc9da7c738f4088e669
[irspy-moved-to-github.git] / bin / irspy.pl
1 #!/usr/bin/perl -w
2
3 # $Id: irspy.pl,v 1.8 2006-09-22 15:29:24 mike Exp $
4 #
5 # Run like this:
6 #       YAZ_LOG=irspy,irspy_test,irspy_debug perl -I ../lib irspy.pl localhost:3313/IR-Explain---1 bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager "edcsns17.cr.usgs.gov:6675/CORONA SATELLITE PHOTOGRAPHY"
7
8 use strict;
9 use warnings;
10 use ZOOM::IRSpy;
11
12 my($dbname, @targets) = @ARGV;
13 if (!defined $dbname) {
14     print STDERR "Usage $0: <IRSpy-database> [<target> ...]\n";
15     print STDERR "If no targets are specified, all targets in DB are tested\n";
16     exit 1;
17 }
18
19 my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat");
20 $spy->targets(@targets) if @targets;
21 $spy->initialise();
22 my $res = $spy->check();
23 if ($res == 0) {
24     print "All tests were run\n";
25 } else {
26     print "Some tests were skipped\n";
27 }