#!/bin/sh
#
# FILE NAME:  sysv/ftp_sysv
#
# This is an interface program which prints to an Axis print server using
# ftp in a System V Unix environment.
#
# (C) Copyright 1993, Axis Communications AB, LUND, SWEDEN.
#
# Version 2.1 Apr 26, 1993 RW.
#
# 1. Set "internet_address" to the internet address of your print server.
#    If you have assigned the print server a name in /etc/hosts, you can
#    use that name instead.
#
internet_address=192.36.253.80
#
# 2. Set "logical_printer" to the logical printer you wish to use on the
#    print server.
#
logical_printer=pr1
#
# 3. Set "ftp_path" to the full pathname of your ftp program.
#
ftp_path=/usr/bin/ftp
#
# 4. Set "login_name" and "password" to the login name and password you
#    wish to use on the print server. Normally, "anyone" and "none",
#    respectively, will suffice.
#
login_name=anyone
password=none
#
# 5. If you have more than one printer queue printing via Axis print servers,
#    remember that each queue must have a seperate interface program (e.g.
#    copy of this file) set up accordingly.
#
# ---- main body of script begins here ---
#
copies=$4
shift; shift; shift; shift; shift
files="$*"
i=1
while [ $i -le $copies ]
do
   for file in $files
   do
      /bin/cat > /tmp/ftp-$$.axis << endftp
user $login_name $password
binary
put $file $logical_printer
quit
endftp
      $ftp_path -n $internet_address < /tmp/ftp-$$.axis
      /bin/rm /tmp/ftp-$$.axis
   done
   i=`expr $i + 1`
done
exit 0
