#! /bin/sh
#++++++++++++++++
# Copyright:    (C) 2008-2017 UDS/CNRS
# License:       GNU General Public License
#.IDENTIFICATION lscat
#.LANGUAGE       Bourne shell
#.AUTHOR         Francois Ochsenbein [CDS]
#.ENVIRONMENT    
#.KEYWORDS       
#.VERSION  1.0   18-Feb-1993
#.VERSION  1.1   29-Aug-2009: http + bourne shell
#.PURPOSE        List the files making up a catalogue
#.COMMENTS       
#----------------

D_BIN=`dirname $0`
PATH="$D_BIN:$PATH"
server=cdsarc.u-strasbg.fr	# The only server for catalogs

if test $# -eq 0 ; then
    echo "Usage: `basename $0` CDS-catalogue(s)..."
    echo "  e.g. `basename $0` I/239"
    exit 1
fi

which aclient | awk 'NF!=1{exit 1}'; use_http=$?
test -z "$http_proxy" || use_http=1

if [ $use_http -eq 0 ]; then
    rcon="aclient $server 1660"
else
    rcon="aclient_cgi $server"
fi

exec $rcon lscat "$@"
