#!/bin/csh -b -e
set path=(/bin /usr/bin /usr/ucb /usr/local/bin)
set mudtmp = /tmp/mud.$$
#Ask: Enter the common name of the MUD (i.e. "Moral Decay"):
set mudname = $<
#Ask: Enter the TCP address of the MUD:
set tcpname = $<
#Ask: Enter the port number of the MUD:
set port = $<
#Ask: Enter Administrator's E-mail address:
set xaddr = $<
#Ask: Enter Guest account name and password:
set guest = $<
#Ask: Enter type of MUD:
set xtype = $<
#Ask: Enter theme:
set theme = $<
#Ask: Enter hours available (skip for constant availability):
set hours = $<
#Ask: Enter type of MUD if ADULT:
set adult = $<
#
# Strip out special characters to avoid crackers (and cheese :-))
#
set adminaddr = `echo $xaddr|/usr/bin/tr -cd '[^A-Za-z0-1@._-+=#&:;,~]' `
set type = `echo $xtype|/usr/bin/tr -cd '[^A-Za-z0-1@._-+=#&:;,~]' `

echo "Registration:"
/bin/rm -f $mudtmp

echo "#Date submitted: `/bin/date`"	>> $mudtmp
echo "#Admin: $adminaddr"		>> $mudtmp
echo "#Type of MUD: $type"		>> $mudtmp
echo "#Hours of operation: $hours"	>> $mudtmp
echo "#Theme: $theme"			>> $mudtmp
echo "#Adult? $adult"			>> $mudtmp
echo "Name=$mudname"			>> $mudtmp
echo "Type=8"				>> $mudtmp
echo "Host=$tcpname"			>> $mudtmp
echo "Abstract=$theme"			>> $mudtmp
echo "Admin=$adminaddr"			>> $mudtmp
echo "Port=$port"			>> $mudtmp
echo "Path=$guest"			>> $mudtmp

/bin/cat $mudtmp
echo "Your registration will be authenticated as soon as possible"
/bin/cat $mudtmp | /usr/ucb/Mail -s "MUD registration" alberti@mudhoney.micro.umn.edu
/bin/mkdir new/$type
/usr/bin/touch new/$type/.Link
/bin/cat $mudtmp >> new/$type/.Link
/bin/rm -f $mudtmp
