#! /bin/sh
: &&O='cd .' || exec /bin/sh "$0" $argv:q # we're in a csh, feed myself to sh
$O || exec /bin/sh "$0" "$@"		  # we're in a buggy zsh
#########################################################################
#	doxcommand	To send of X-Command mails			#
#									#
#	Created by S.R. van den Berg, The Netherlands			#
#									#
#	Customise to taste.						#
#########################################################################
#$Id: doxcommand,v 1.7 1994/09/20 19:33:27 berg Exp $

#
# Edit the following three definitions to suit your list
#

listrequest=yourlist-request@some.where
maintainer=yourname@some.where
password=x_command_password

#
# In a standard environment you shouldn't need to make any changes below
# this line
#

test=test			# /bin/test
echo=echo			# /bin/echo
sendmail=/usr/lib/sendmail	# /usr/lib/sendmail

$test $# = 0 && $echo "Usage: $0 command [argument] ..." 1>&2 &&
 exit 64

command="$1"
shift

# Allow for abbreviations or misspellings (people are lazy by nature :-)

case "$command" in
  su*) command=subscribe ;;
  u*) command=unsubscribe ;;
  c*) command=checkdist ;;
  showd*|sd*|shd*) command=showdist ;;
  showl*|sl*|shl*) command=showlog ;;
  w*) command=wipelog ;;
  v*) command=version ;;
  h*) command=help ;;
  i*) command=info ;;
  *) $echo "Unknown command, use any of the following:" 1>&2
     $echo "subscribe, unsubscribe, checkdist, showdist, showlog," 1>&2
     $echo "wipelog, version, help or info." 1>&2
     exit 64
esac

$sendmail $listrequest <<HERE
To: $listrequest
X-Command: $maintainer $password $command $*
Subject: X-Processed: $command $* of <$listrequest>


HERE
