#!/bin/sh

# Check the number of arguments

if [ $# -ne 2 ]
then
	echo "Usage: qstatus status|jobs printerhostname"
	exit 2
fi

# Make sure the first argument is legal

case $1 in
	status)
		;;
	jobs)
		;;
	*)
		echo "Usage: qstatus status|jobs printerhostname"
		exit 1
		;;
esac

echo " cd $1" > /tmp/qstat.$$
echo " dir" >> /tmp/qstat.$$
echo " bye" >> /tmp/qstat.$$

ftp -n $2 < /tmp/qstat.$$

rm /tmp/qstat.$$
