2 # InspIRCd Configuration Creator
4 # Copyright 2003 The ChatSpike Development Team
5 # <Craig@chatspike.net>
6 # <brain@chatspike.net>
11 ########################################################
13 echo "Configuring Default Values"
16 TEMP="$ME/makeconf.temp"
17 SERV_NAME="my.server.name"
18 SERV_DESC="My InspIRCd Server"
23 ADMIN_MAIL="My@E-Mail.Address"
26 RESTART_PASS="RestartNow"
30 CONNECT_PASS="ServerPass"
32 VHOST_DOMAIN="inspircd.org"
39 FILES_MOTD="$ME/conf/inspire.motd"
40 FILES_RULE="$ME/conf/inspire.rules"
54 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
61 echo -e "'\033[1;33m####\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::'\033[1;33m####\033[0;37m:'\033[1;33m########\033[0;37m:::'\033[1;33m######\033[0;37m::'\033[1;33m########\033[0;37m::"
62 echo -e ". \033[1;33m##\033[0;37m:: \033[1;33m###\033[0;37m:: \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:'\033[1;33m##\033[0;37m... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.... \033[1;33m##\033[0;37m:"
63 echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::..:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::..:: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:"
64 echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m \033[1;33m##\033[0;37m \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m########\033[0;37m::: \033[1;33m##\033[0;37m:: \033[1;33m########\033[0;37m:: \033[1;33m##\033[0;37m::::::: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:"
65 echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m. \033[1;33m####\033[0;37m::..... \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m.....:::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m.. \033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m::::::: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:"
66 echo -e ": \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m:. \033[1;33m###\033[0;37m:'\033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m::::::::: \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m::. \033[1;33m##\033[0;37m:: \033[1;33m##\033[0;37m::: \033[1;33m##\033[0;37m: \033[1;33m##\033[0;37m:::: \033[1;33m##\033[0;37m:"
67 echo -e "'\033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m::. \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m##\033[0;37m::::::::'\033[1;33m####\033[0;37m: \033[1;33m##\033[0;37m:::. \033[1;33m##\033[0;37m:. \033[1;33m######\033[0;37m:: \033[1;33m########\033[0;37m::"
68 echo -e "\033[0;37m\033[0;37m....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::"
70 echo -e "\033[1;37mWelcome to the inspircd.conf file maker!!"
72 echo -e "*** Although with most values, hitting \033[1;37m<RETURN>\033[0;37m will use the default, ***"
73 echo "*** others are not like this. Where possible, Please fill in all the ***"
74 echo "*** values manually. Once complete, you *WILL* be required to edit ***"
75 echo "*** the created file manually, to ensure values are correct. Enjoy! ***"
76 echo -e "*** Between the [\033[1;32mBRACKETS\033[0;37m] will be default / example values to help ***"
81 echo "The first Part of this is the server Configuration. Here we will take"
82 echo "Details, Such as the servers name, Description, and The administrators"
83 echo "information. Once complete, the Screen will clear, and stage 2 will begin"
86 echo "Enter Servers Name"
87 echo -e $n "[\033[1;32m$SERV_NAME\033[0;37m] -> $c"
95 echo "Enter Server Description"
96 echo -e $n "[\033[1;32m$SERV_DESC\033[0;37m] -> $c"
104 echo "Enter Your Network Name"
105 echo -e $n "[\033[1;32m$SERV_NET\033[0;37m] -> $c"
116 echo "Enter Administrators Full Name"
117 echo -e $n "[\033[1;32m$ADMIN_NAME\033[0;37m] -> $c"
125 echo "Enter Administrators NickName"
126 echo -e $n "[\033[1;32m$ADMIN_NICK\033[0;37m] -> $c"
134 echo "Enter Administrators Email Address"
135 echo -e $n "[\033[1;32m$ADMIN_MAIL\033[0;37m] -> $c"
142 echo "Section Complete, Writing Config File Header."
145 # Config file header Here!
148 echo "########################################################################" >> $TEMP
150 echo "# --------------------------- #" >> $TEMP
151 echo "# InspIRCd Configuration File #" >> $TEMP
152 echo "# --------------------------- #" >> $TEMP
154 echo "##################################||####################################" >> $TEMP
155 echo " #||#" >> $TEMP
156 echo "##################################||####################################" >> $TEMP
158 echo "# This is an example of the config file for InspIRCd. #" >> $TEMP
159 echo "# Change the options to suit your network #" >> $TEMP
161 echo "# Written by : makeconf (Craig@inspircd.org) #" >> $TEMP
163 echo "########################################################################" >> $TEMP
168 # Complete, server tag now
171 echo "#-#-#-#-#-#-#-#-#-#-#-#- SERVER DESCRIPTION -#-#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
172 echo "<server name=\"$SERV_NAME\"" >> $TEMP
173 echo " description=\"$SERV_DESC\"" >> $TEMP
174 echo " network=\"$SERV_NET\">" >> $TEMP
182 echo "#-#-#-#-#-#-#-#-#-#-#-#- ADMIN INFORMATION -#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
183 echo "<admin name=\"$ADMIN_NAME\"" >> $TEMP
184 echo " nick=\"$ADMIN_NICK\"" >> $TEMP
185 echo " email=\"$ADMIN_MAIL\">" >> $TEMP
194 echo "Congratulations, you have successfully Configured your Server and Administrator"
195 echo "Information Correctly. Proceeding to Servers Port Configuration."
200 echo "Now its time to specify which IP and ports you wish to run the IRCd on."
201 echo "When asked please enter the IP Address, and ports. As a note, you may"
202 echo "Leave the IP Address blank to bind to all avaliable interfaces."
204 echo "To end, either type \"done\" as the IP, or leave the Port Blank."
208 # Write Config Header..
211 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
213 echo "# Just remove this... Its here to make you read through this file #" >> $TEMP
214 echo "# properly after running \"makeconf\" #" >> $TEMP
216 echo "<die value=\"tut tut, someone didnt check their config file properly\">" >> $TEMP
221 echo "#-#-#-#-#-#-#-#-#-#-#-#- PORT CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
224 # Ok, done.. Proceed :)
230 while [ $ok -eq 0 ] ; do
234 if [ "$cc" == "done" ] ; then
239 if [ "$ok" != "1" ] ; then
240 echo -e "Ports Already Bound: \033[1;32m$BOUND_PORT\033[0;37m"
241 echo "Enter Port to Bind to $BIND_IP"
244 if [ ! "$cc" ] ; then
248 BOUND_PORT="$BOUND_PORT $cc"
249 echo "<bind address=\"$BIND_IP\" port=\"$cc\">" >> $TEMP
254 if [ "$default" == "0" ] ; then
255 echo "<bind address=\"\" port=\"6667\">" >> $TEMP
259 # OoOok.. Finishing section
266 # Finished, Port Configuration Complete :D
271 if [ "$default" == "0" ] ; then
272 echo "<bind address=\"\" port=\"6667\">" >> $TEMP
276 echo "See? that wasnt so hard, The next bit is easier, just more important."
280 echo "I now need you to specify Passwords which will shut down, and restart"
281 echo "your server, these are _IMPORTANT_ and i will not allow you to use the"
282 echo "default passwords, you must use your own."
284 while [ $ok -eq 0 ] ; do
286 echo "Enter the password to Kill the IRCd"
287 echo -e $n "[\033[1;32m$DIE_PASS\033[0;37m] -> $c"
289 if [ ! "$cc" ] ; then
291 echo "You _MUST_ specify your Own Password, try again."
301 while [ $ok -eq 0 ] ; do
303 echo "Now Enter the Password you will use to Restart."
304 echo -e $n "[\033[1;32m$RESTART_PASS\033[0;37m] -> $c"
306 if [ ! "$cc" ] ; then
308 echo "You _MUST_ specify your Own Password, try again."
316 echo "Enter the Pause Between Issuing a DIE/RESTART request to the IRCd Actually doing it [in Seconds]"
317 echo -e $n "[\033[1;32m$DIE_WAIT\033[0;37m] -> $c"
324 # Now Write the config.. What phun
327 echo "#-#-#-#-#-#-#-#-#-#- DIE/RESTART CONFIGURATION -#-#-#-#-#-#-#-#-#-#-" >> $TEMP
328 echo "<power diepass=\"$DIE_PASS\"" >> $TEMP
329 echo " restartpass=\"$RESTART_PASS\"" >> $TEMP
330 echo " pause=\"$DIE_WAIT\">" >> $TEMP
335 # <Insert done comment here>
338 echo "ok, seeing as we managed that, we have to Arrange a list of people allowed to connect :)"
342 echo "This section allows you to Specify who is allowed Access to the IRCd. IP Addresses only Please"
343 echo "Although you can choose to use wildcards if you please. The default is * with no password."
344 echo "Type \"done\" at the IP Address, or leave it blank to finish, you do _NOT_ have to specify"
350 # Just another Friendly Header :p
353 echo "#-#-#-#-#-#-#-#-#-#- CONNECTIONS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-" >> $TEMP
358 while [ $ok -eq 0 ] ; do
360 echo "Enter The IP Address"
361 echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c"
363 if [ "$cc" == "done" ] ; then
365 elif [ ! "$cc" ] ; then
370 if [ "$ok" != "1" ] ; then
371 echo "A Registration Timeout is the time it takes before Ping Timeouting"
372 echo "a client trying to connect to the server, which hasnt issued the initial"
373 echo "commands. It is recommended that you set this to 90, if you give no"
374 echo "value, the default will be used."
375 echo "Enter 'registration' timeout"
376 echo $n "[\033[1;32m90\033[0;37m] -> $c"
378 if [ ! "$cc" ] ; then
383 echo "Enter Password [If Applicable]"
386 if [ ! "$cc" ] ; then
388 echo "<connect allow=\"$ALLOW_IP\" timeout=\"$TIMEOUT\">" >> $TEMP
390 echo "<connect allow=\"$ALLOW_IP\" password=\"$cc\" timeout=\"$TIMEOUT\>" >> $TEMP
394 if [ "$default" == "0" ] ; then
395 echo "<connect allow=\"*\">" >> $TEMP
399 # Insert Line Break before deny
409 if [ "$default" == "0" ] ; then
410 echo "No allow lines Specified, using defaults."
414 echo "Now For the denies.. These will prevent users accessing the server, once again,"
415 echo "entering nothing, or \"done\" will complete the cycle, and allow you to continue"
417 echo "Enter the IP Address"
419 while [ $ok -eq 0 ] ; do
420 echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c"
422 if [ "$cc" == "done" ] ; then
424 elif [ ! "$cc" ] ; then
427 echo "<connect deny=\"$cc\">" >> $TEMP
439 echo "Ok, now thats finished, we come to oper Classes And Compositions. Due to the Nature"
440 echo "of this, this Script will set the default tags, if you wish to change them, you will"
441 echo "have to edit the Finished config manually, in most cases they shouldnt be changed."
445 echo "Before we do that thou, i need to ask for the Domain name of your server, for example,"
446 echo "chatspike.net. This will be used To generate your vhosts."
447 echo -e $n "[\033[1;32m$VHOST_DOMAIN\033[0;37m] -> $c"
453 echo "#-#-#-#-#-#-#-#-#-#-#-#- CLASS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
454 echo "<class name=\"Shutdown\" commands=\"DIE RESTART REHASH\">" >> $TEMP
455 echo "<class name=\"ServerLink\" commands=\"CONNECT SQUIT\">" >> $TEMP
456 echo "<class name=\"BanControl\" commands=\"KILL GLINE KLINE ZLINE QLINE SHUN\">" >> $TEMP
457 echo "<class name=\"OperChat\" commands=\"WALLOPS CHATOPS\">" >> $TEMP
458 echo "<class name=\"HostCloak\" commands=\"SETHOST SETIDENT SETNAME\">" >> $TEMP
461 echo "#-#-#-#-#-#-#-#-#-#-#-#- OPERATOR COMPOSITION -#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
462 echo "<type name=\"NetAdmin\" classes=\"OperChat BanControl HostCloak Shutdown ServerLink\" host=\"netadmin.$VHOST_DOMAIN\">" >> $TEMP
463 echo "<type name=\"GlobalOp\" classes=\"OperChat BanControl HostCloak ServerLink\" host=\"ircop.$VHOST_DOMAIN\">" >> $TEMP
464 echo "<type name=\"LocalOp\" classes=\"OperChat BanControl HostCloak\" host=\"local.$VHOST_DOMAIN\">" >> $TEMP
465 echo "<type name=\"Helper\" classes=\"HostCloak\" host=\"helper.$VHOST_DOMAIN\">" >> $TEMP
469 echo "Yay, now comes the fun Part, time to specify Opers."
473 echo "Ok, heres the deal, gonna ask you four questions, all require answering. They are as follows:"
474 echo "1) The Opers Login, This part will replace <login> in /oper <login> <password>"
475 echo "2) The Opers Password, This will replace <password> in /oper <login> <password>"
476 echo "3) The Opers Host, The oper must be connecting from this host for /oper to work [user@host]"
477 echo "4) The Opers Class, currently all avaliable are: \"NetAdmin\", \"GlobalOp\", \"LocalOp\" and \"Helper\""
479 echo "You may re-configure the classes later, and if you enter nothing for part one, we will proceed to the next step"
483 # Stolen another few lines >;)
486 echo "#-#-#-#-#-#-#-#-#-#-#- OPERATOR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
493 while [ $ok -eq 0 ] ; do
494 echo "Enter the opers login name"
495 echo -e $n "[\033[1;32m$OPER_NICK\033[0;37m] -> $c"
497 if [ ! "$cc" ] ; then
502 if [ $ok -eq 0 ] ; then
504 while [ $ok2 -eq 0 ] ; do
505 echo "Enter the Opers Password"
506 echo -e $n "[\033[1;32m$OPER_PASS\033[0;37m] -> $c"
508 if [ ! "$cc" ] ; then
509 echo "You _MUST_ Enter a password"
515 echo "Enter Opers Host [Format User@host]"
516 echo -e $n "[\033[1;32m$OPER_HOST\033[0;37m] -> $c"
518 if [ ! "$cc" ] ; then
523 echo "Enter Opers Type [Avaliable: NetAdmin, GlobalOp, LocalOp and Helper] CHOOSE ONLY ONE"
524 echo -e $n "[\033[1;32m$OPER_TYPE\033[0;37m] -> $c"
526 if [ ! "$cc" ] ; then
531 echo "Coming for a re-run"
533 echo "<oper name=\"$OPER_LOGIN\"" >> $TEMP
534 echo " password=\"$OPER_PASS\"" >> $TEMP
535 echo " host=\"$OPER_HOST\"" >> $TEMP
536 echo " type=\"$OPER_TYPE\">" >> $TEMP
544 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
545 echo "# You should know what to do here.. if not.. RTFM!! muahahahahaha #" >> $TEMP
547 echo "<die value=\"And god came down from the heavens and smote down the noob.\">" >> $TEMP
553 echo "Congratulations, Your Opers are configured!"
556 echo "Right, i have guessed where you Message of the Day and Rules Files will be."
557 echo "If these are correct, just hit return, else, type in the correct Location."
559 echo "First The Message of the day."
560 echo -e $n "[\033[1;32m$FILES_MOTD\033[0;37m] -> $c"
566 echo "Right, now the Rules file."
567 echo -e $n "[\033[1;32m$FILES_RULE\033[0;37m] -> $c"
573 echo "#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-" >> $TEMP
574 echo "<files motd=\"$FILES_MOTD\"" >> $TEMP
575 echo " rules=\"$FILES_RULE\">" >> $TEMP
582 echo "Enter the Names of the modules you wish to load, one at a time, below."
583 echo "Type in the name, hit return, type in another one, etc. Once complete, just hit return to end."
585 echo "The Following Modules are avaliable:"
588 for module in src/modules/*.cpp ; do
589 desc=`grep '$ModDesc:' $module | sed 's/\/\* $ModDesc://' | sed 's/\*\///'`
590 mod=`echo $module | sed 's/.cpp/.so/' | sed 's/src\/modules\///'`
591 echo -e "\033[1;32m$mod\t\t\033[0;37m$desc"
599 echo "#-#-#-#-#-#-#-#-#-#-#-#-#- MODULE OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
605 while [ "$ok" -eq 0 ] ; do
609 echo "<module name=\"$cc\">" >> $TEMP
620 echo "This is it, The final set of Variables.. Then your config is complete."
623 echo "These are just a few tiny Simple things, well explained.. BEGIN!"
625 echo "Quit Prefix, This comes before all users Quits, it can be what you like."
626 echo -e $n "[\033[1;32m$OP_PREFIX\033[0;37m] -> $c"
633 echo "Maximum Number of results for a /who (Between 1 and 65535) Default 128."
634 echo -e $n "[\033[1;32m$OP_MAWHO\033[0;37m] -> $c"
645 echo "Log level [debug, verbose, default, sparse, none]"
646 echo -e $n "[\033[1;32m$OP_DEBUG\033[0;37m] -> $c"
653 echo "Enable Halfops [Channel Mode +h], [yes/no]"
654 echo -e $n "[\033[1;32m$OP_HALFY\033[0;37m] -> $c"
661 echo "Enable User Channel Protection [Channel Mode +a] [yes/no]"
662 echo -e $n "[\033[1;32m$OP_PROTE\033[0;37m] -> $c"
669 echo "Enable Channel Founder? [Channel Mode +q] [yes/no]"
670 echo -e $n "[\033[1;32m$OP_FOUND\033[0;37m] -> $c"
676 echo "#-#-#-#-#-#-#-#-#-#-#-#-#- SERVER OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
677 echo "<options prefixquit=\"$OP_PREFIX\"" >> $TEMP
678 echo " loglevel=\"$OP_DEBUG\"" >> $TEMP
679 echo " allowhalfop=\"$OP_HALFY\"" >> $TEMP
680 echo " allowprotect=\"$OP_PROTE\"" >> $TEMP
681 echo " allowfounder=\"$OP_FOUND\">" >> $TEMP
682 echo " maxwho=\"$OP_MAWHO\">" >> $TEMP
687 DIR=$ME/conf/inspircd.conf
689 echo "LAST QUESTION!!"
690 echo "Where am i gonna be placed? [eg. $DIR]"
691 echo -e $n "[\033[1;32m$DIR\033[0;37m] -> $c"
697 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- YAWN -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
699 echo "# You should already know what to do here :) #" >> $TEMP
701 echo "<die value=\"All l33t noobs must edit their configs.\">" >> $TEMP
704 echo "#########################################################################" >> $TEMP
706 echo "# -InspIRCd Development and Coding Team- #" >> $TEMP
707 echo "# www.inspircd.org #" >> $TEMP
709 echo "#########################################################################" >> $TEMP