#!/bin/sh
#
# FILE NAME: bsd/ftp_bsd
#
# This shell script is to be used as an output or input filter in /etc/printcap
# when printing on an Axis print server using ftp in a BSD environment.
#
# (C) Copyright 1993, Axis Communications AB, LUND, SWEDEN
#
# Version 1.1, Apr 26, 1993 RW
#
# Before installing, the following variables must be set up:
#
# 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/ucb/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
#
# ---- main body of script begins here ---
# 
/bin/cat > /tmp/pr-$$.axis
/bin/cat > /tmp/ftp-$$.axis << endftp
user $login_name $password
binary
put /tmp/pr-$$.axis $logical_printer
quit
endftp
$ftp_path -n $internet_address < /tmp/ftp-$$.axis
/bin/rm /tmp/pr-$$.axis /tmp/ftp-$$.axis
