X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=bin%2Firspy.pl;h=60c2df312bc28313786cd7761341bba62ef98f1e;hp=e6c2cc34f2fe3aa341578ce96176a9c7d41abe86;hb=2a6243bc81d45f0de4abef12435917923425f961;hpb=9ba276aad41eedd554c87cb6518a88edb8e2f6dc diff --git a/bin/irspy.pl b/bin/irspy.pl index e6c2cc3..60c2df3 100755 --- a/bin/irspy.pl +++ b/bin/irspy.pl @@ -1,9 +1,9 @@ #!/usr/bin/perl -w -# $Id: irspy.pl,v 1.2 2006-07-19 11:52:24 mike Exp $ +# $Id: irspy.pl,v 1.9 2006-09-27 13:29:31 mike Exp $ # # Run like this: -# YAZ_LOG=irspy,irspy_test,irspy_debug perl -I ../lib irspy.pl -t "bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager" localhost:1313/IR-Explain---1 +# 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" use strict; use warnings; @@ -11,26 +11,20 @@ use Getopt::Std; use ZOOM::IRSpy; my %opts; -if (!getopts('t:au', \%opts) || @ARGV != 1) { - print STDERR qq[Usage: $0 [options] - -t Space-separated list of targets to check - -a Check all targets registered in database - -u Update information in database -]; +if (!getopts('t:', \%opts) || @ARGV < 1) { + print STDERR "\ +Usage $0: [options] [ ...] +If no targets are specified, all targets in DB are tested. + -t Run the specified [default: all tests] +"; exit 1; } -my $dbname = $ARGV[0]; -my $targetList = $opts{t}; -if (!defined $targetList && !$opts{a}) { - print STDERR "$0: neither -t nor -a specified\n"; - exit 2; -} - -my $spy = new ZOOM::IRSpy($dbname); -$spy->targets($targetList) if defined $targetList; +my($dbname, @targets) = @ARGV; +my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat"); +$spy->targets(@targets) if @targets; $spy->initialise(); -my $res = $spy->check(); +my $res = $spy->check($opts{t}); if ($res == 0) { print "All tests were run\n"; } else {