#! /bin/sh
#! PATH "/usr/bin:/bin:/usr/ucb/bin"
export PATH

echo "Creating a new Configuration File"
echo "What machine will the ircd be running on (Example: gateway.sei.cmu.edu) \c"
read machname
echo "Please tell me some information about your Institution ( Example: Carnegie Mellon University in Pittsburgh, Pa) \c"
read siteinfo
echo "What is the IP address for the site your ircd will be connecting to? \c"
read upip
echo "What is the machine name of the site your ircd will be connecting to( Example: accuvax.nwu.edu) \c"
read upname
echo "What will be the irc name of the operator? \c"
read opname
echo "What will be his password to initiate operator mode in irc? \c"
read oppass
echo "What is the Full name of the IRC administrator for your site? \c"
read adminname
echo "what is their e-mail address? \c"
read adminmail
echo "Please input some miscellaneous info about your irc administrator \c"
read adminmisc
echo "What domain will this ircd serve? {Example: gateway.sei.cmu.edu serves sei.cmu.edu} \c"
read subdom
TMPFILE="/tmp/irc.cf$$"
echo "#This line tells machine name and some info about the site and the default port ircd listens on" >> $TMPFILE
echo "M:$machname:*:$siteinfo:6667" >> $TMPFILE
echo "#This line contains the address of the systems you will be connecting to" >> $TMPFILE
echo "#the way you distinguish systems that you are going to connect to and systems that are gonna connect to you is the 6667 on the end" >> $TMPFILE
echo "#If they have a 6667 on the end, then its a uphost ( meaning you are connecting to it) if not then its a down host and they connect to you " >> $TMPFILE
echo "C:$upip::$upname:6667" >> $TMPFILE
echo "#This line goes along with the C line, it is the same for a uphost or a downhost, it does NOT have a 6667 on the end of it." >> $TMPFILE
echo "N:$upip::$upname" >> $TMPFILE
echo "#This line shows administrative info about your site" >> $TMPFILE
echo "A:$adminname:$adminmisc:$adminmail" >> $TMPFILE
echo "#This Line shows the default server for clients to use" >> $TMPFILE
echo "U:$machname::$machname:6667" >> $TMPFILE
echo "#This line shows what all clients it will allow to connect to its server" >> $TMPFILE
echo "I:*.$subdom::*.$subdom" >> $TMPFILE
echo "#This line setups the id and password to initiate operator mode" >> $TMPFILE
echo "O:*.$subdom:$oppass:$opname" >> $TMPFILE
echo "What is the full Path to the config file? (Example: /usr/users/vijay/IRC/irc.conf) \c"
read conffile
echo "This is what your irc.conf file is going to look like"
cat $TMPFILE
cp $TMPFILE $conffile
rm $TMPFILE
echo "Your Configuration file has been created."
echo "Have a Nice Day."
fi
