2 # InspIRCd Configuration Creator
4 # Copyright 2003 The ChatSpike Development Team
5 # <Craig@chatspike.net>
6 # <brain@chatspike.net>
10 ########################################################
12 echo "Configuring Default Values"
15 TEMP="$ME/makeconf.temp"
16 SERV_NAME="my.server.name"
17 SERV_DESC="My InspIRCd Server"
22 ADMIN_MAIL="My@E-Mail.Address"
25 RESTART_PASS="RestartNow"
29 CONNECT_PASS="ServerPass"
31 VHOST_DOMAIN="inspircd.org"
38 FILES_MOTD="$ME/conf/inspire.motd"
39 FILES_RULE="$ME/conf/inspire.rules"
53 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
60 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::"
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.... \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:"
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:"
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: \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::"
67 echo -e "\033[0;37m\033[0;37m....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::"
69 echo -e "\033[1;37mWelcome to the inspircd.conf file maker!!"
71 echo -e "*** Although with most values, hitting \033[1;37m<RETURN>\033[0;37m will use the default, ***"
72 echo "*** others are not like this. Where possible, Please fill in all the ***"
73 echo "*** values manually. Once complete, you *WILL* be required to edit ***"
74 echo "*** the created file manually, to ensure values are correct. Enjoy! ***"
75 echo -e "*** Between the [\033[1;32mBRACKETS\033[0;37m] will be default / example values to help ***"
80 echo "The first Part of this is the server Configuration. Here we will take"
81 echo "Details, Such as the servers name, Description, and The administrators"
82 echo "information. Once complete, the Screen will clear, and stage 2 will begin"
85 echo "Enter Servers Name"
86 echo -e $n "[\033[1;32m$SERV_NAME\033[0;37m] -> $c"
94 echo "Enter Server Description"
95 echo -e $n "[\033[1;32m$SERV_DESC\033[0;37m] -> $c"
103 echo "Enter Your Network Name"
104 echo -e $n "[\033[1;32m$SERV_NET\033[0;37m] -> $c"
115 echo "Enter Administrators Full Name"
116 echo -e $n "[\033[1;32m$ADMIN_NAME\033[0;37m] -> $c"
124 echo "Enter Administrators NickName"
125 echo -e $n "[\033[1;32m$ADMIN_NICK\033[0;37m] -> $c"
133 echo "Enter Administrators Email Address"
134 echo -e $n "[\033[1;32m$ADMIN_MAIL\033[0;37m] -> $c"
141 echo "Section Complete, Writing Config File Header."
144 # Config file header Here!
147 echo "########################################################################" >> $TEMP
149 echo "# --------------------------- #" >> $TEMP
150 echo "# InspIRCd Configuration File #" >> $TEMP
151 echo "# --------------------------- #" >> $TEMP
153 echo "##################################||####################################" >> $TEMP
154 echo " #||#" >> $TEMP
155 echo "##################################||####################################" >> $TEMP
157 echo "# This is an example of the config file for InspIRCd. #" >> $TEMP
158 echo "# Change the options to suit your network #" >> $TEMP
160 echo "# Written by : makeconf (Craig@inspircd.org) #" >> $TEMP
162 echo "########################################################################" >> $TEMP
167 # Complete, server tag now
170 echo "#-#-#-#-#-#-#-#-#-#-#-#- SERVER DESCRIPTION -#-#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
171 echo "<server name=\"$SERV_NAME\"" >> $TEMP
172 echo " description=\"$SERV_DESC\"" >> $TEMP
173 echo " network=\"$SERV_NET\">" >> $TEMP
181 echo "#-#-#-#-#-#-#-#-#-#-#-#- ADMIN INFORMATION -#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
182 echo "<admin name=\"$ADMIN_NAME\"" >> $TEMP
183 echo " nick=\"$ADMIN_NICK\"" >> $TEMP
184 echo " email=\"$ADMIN_MAIL\">" >> $TEMP
193 echo "Congratulations, you have successfully Configured your Server and Administrator"
194 echo "Information Correctly. Proceeding to Servers Port Configuration."
199 echo "Now its time to specify which IP and ports you wish to run the IRCd on."
200 echo "When asked please enter the IP Address, and ports. As a note, you may"
201 echo "Leave the IP Address blank to bind to all avaliable interfaces."
203 echo "To end, either type \"done\" as the IP, or leave the Port Blank."
207 # Write Config Header..
210 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
212 echo "# Just remove this... Its here to make you read through this file #" >> $TEMP
213 echo "# properly after running \"makeconf\" #" >> $TEMP
215 echo "<die value=\"tut tut, someone didnt check their config file properly\">" >> $TEMP
220 echo "#-#-#-#-#-#-#-#-#-#-#-#- PORT CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
223 # Ok, done.. Proceed :)
229 while [ $ok -eq 0 ] ; do
233 if [ "$cc" == "done" ] ; then
238 if [ "$ok" != "1" ] ; then
239 echo -e "Ports Already Bound: \033[1;32m$BOUND_PORT\033[0;37m"
240 echo "Enter Port to Bind to $BIND_IP"
243 if [ ! "$cc" ] ; then
247 BOUND_PORT="$BOUND_PORT $cc"
248 echo "<bind address=\"$BIND_IP\" port=\"$cc\">" >> $TEMP
253 if [ "$default" == "0" ] ; then
254 echo "<bind address=\"\" port=\"6667\">" >> $TEMP
258 # OoOok.. Finishing section
265 # Finished, Port Configuration Complete :D
270 if [ "$default" == "0" ] ; then
271 echo "<bind address=\"\" port=\"6667\">" >> $TEMP
275 echo "See? that wasnt so hard, The next bit is easier, just more important."
279 echo "I now need you to specify Passwords which will shut down, and restart"
280 echo "your server, these are _IMPORTANT_ and i will not allow you to use the"
281 echo "default passwords, you must use your own."
283 while [ $ok -eq 0 ] ; do
285 echo "Enter the password to Kill the IRCd"
286 echo -e $n "[\033[1;32m$DIE_PASS\033[0;37m] -> $c"
288 if [ ! "$cc" ] ; then
290 echo "You _MUST_ specify your Own Password, try again."
300 while [ $ok -eq 0 ] ; do
302 echo "Now Enter the Password you will use to Restart."
303 echo -e $n "[\033[1;32m$RESTART_PASS\033[0;37m] -> $c"
305 if [ ! "$cc" ] ; then
307 echo "You _MUST_ specify your Own Password, try again."
315 echo "Enter the Pause Between Issuing a DIE/RESTART request to the IRCd Actually doing it [in Seconds]"
316 echo -e $n "[\033[1;32m$DIE_WAIT\033[0;37m] -> $c"
323 # Now Write the config.. What phun
326 echo "#-#-#-#-#-#-#-#-#-#- DIE/RESTART CONFIGURATION -#-#-#-#-#-#-#-#-#-#-" >> $TEMP
327 echo "<power diepass=\"$DIE_PASS\"" >> $TEMP
328 echo " restartpass=\"$RESTART_PASS\"" >> $TEMP
329 echo " pause=\"$DIE_WAIT\">" >> $TEMP
334 # <Insert done comment here>
337 echo "ok, seeing as we managed that, we have to Arrange a list of people allowed to connect :)"
341 echo "This section allows you to Specify who is allowed Access to the IRCd. IP Addresses only Please"
342 echo "Although you can choose to use wildcards if you please. The default is * with no password."
343 echo "Type \"done\" at the IP Address, or leave it blank to finish, you do _NOT_ have to specify"
349 # Just another Friendly Header :p
352 echo "#-#-#-#-#-#-#-#-#-#- CONNECTIONS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-" >> $TEMP
357 while [ $ok -eq 0 ] ; do
359 echo "Enter The IP Address"
360 echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c"
362 if [ "$cc" == "done" ] ; then
364 elif [ ! "$cc" ] ; then
369 if [ "$ok" != "1" ] ; then
370 echo "A Registration Timeout is the time it takes before Ping Timeouting"
371 echo "a client trying to connect to the server, which hasnt issued the initial"
372 echo "commands. It is recommended that you set this to 90, if you give no"
373 echo "value, the default will be used."
374 echo "Enter 'registration' timeout"
375 echo $n "[\033[1;32m90\033[0;37m] -> $c"
377 if [ ! "$cc" ] ; then
382 echo "Enter Password [If Applicable]"
385 if [ ! "$cc" ] ; then
387 echo "<connect allow=\"$ALLOW_IP\" timeout=\"$TIMEOUT\">" >> $TEMP
389 echo "<connect allow=\"$ALLOW_IP\" password=\"$cc\" timeout=\"$TIMEOUT\>" >> $TEMP
393 if [ "$default" == "0" ] ; then
394 echo "<connect allow=\"*\">" >> $TEMP
398 # Insert Line Break before deny
408 if [ "$default" == "0" ] ; then
409 echo "No allow lines Specified, using defaults."
413 echo "Now For the denies.. These will prevent users accessing the server, once again,"
414 echo "entering nothing, or \"done\" will complete the cycle, and allow you to continue"
416 echo "Enter the IP Address"
418 while [ $ok -eq 0 ] ; do
419 echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c"
421 if [ "$cc" == "done" ] ; then
423 elif [ ! "$cc" ] ; then
426 echo "<connect deny=\"$cc\">" >> $TEMP
438 echo "Ok, now thats finished, we come to oper Classes And Compositions. Due to the Nature"
439 echo "of this, this Script will set the default tags, if you wish to change them, you will"
440 echo "have to edit the Finished config manually, in most cases they shouldnt be changed."
444 echo "Before we do that thou, i need to ask for the Domain name of your server, for example,"
445 echo "chatspike.net. This will be used To generate your vhosts."
446 echo -e $n "[\033[1;32m$VHOST_DOMAIN\033[0;37m] -> $c"
452 echo "#-#-#-#-#-#-#-#-#-#-#-#- CLASS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
453 echo "<class name=\"Shutdown\" commands=\"DIE RESTART REHASH\">" >> $TEMP
454 echo "<class name=\"ServerLink\" commands=\"CONNECT SQUIT\">" >> $TEMP
455 echo "<class name=\"BanControl\" commands=\"KILL GLINE KLINE ZLINE QLINE SHUN\">" >> $TEMP
456 echo "<class name=\"OperChat\" commands=\"WALLOPS CHATOPS\">" >> $TEMP
457 echo "<class name=\"HostCloak\" commands=\"SETHOST SETIDENT SETNAME\">" >> $TEMP
460 echo "#-#-#-#-#-#-#-#-#-#-#-#- OPERATOR COMPOSITION -#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
461 echo "<type name=\"NetAdmin\" classes=\"OperChat BanControl HostCloak Shutdown ServerLink\" host=\"netadmin.$VHOST_DOMAIN\">" >> $TEMP
462 echo "<type name=\"GlobalOp\" classes=\"OperChat BanControl HostCloak ServerLink\" host=\"ircop.$VHOST_DOMAIN\">" >> $TEMP
463 echo "<type name=\"LocalOp\" classes=\"OperChat BanControl HostCloak\" host=\"local.$VHOST_DOMAIN\">" >> $TEMP
464 echo "<type name=\"Helper\" classes=\"HostCloak\" host=\"helper.$VHOST_DOMAIN\">" >> $TEMP
468 echo "Yay, now comes the fun Part, time to specify Opers."
472 echo "Ok, heres the deal, gonna ask you four questions, all require answering. They are as follows:"
473 echo "1) The Opers Login, This part will replace <login> in /oper <login> <password>"
474 echo "2) The Opers Password, This will replace <password> in /oper <login> <password>"
475 echo "3) The Opers Host, The oper must be connecting from this host for /oper to work [user@host]"
476 echo "4) The Opers Class, currently all avaliable are: \"NetAdmin\", \"GlobalOp\", \"LocalOp\" and \"Helper\""
478 echo "You may re-configure the classes later, and if you enter nothing for part one, we will proceed to the next step"
482 # Stolen another few lines >;)
485 echo "#-#-#-#-#-#-#-#-#-#-#- OPERATOR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
492 while [ $ok -eq 0 ] ; do
493 echo "Enter the opers login name"
494 echo -e $n "[\033[1;32m$OPER_NICK\033[0;37m] -> $c"
496 if [ ! "$cc" ] ; then
501 if [ $ok -eq 0 ] ; then
503 while [ $ok2 -eq 0 ] ; do
504 echo "Enter the Opers Password"
505 echo -e $n "[\033[1;32m$OPER_PASS\033[0;37m] -> $c"
507 if [ ! "$cc" ] ; then
508 echo "You _MUST_ Enter a password"
514 echo "Enter Opers Host [Format User@host]"
515 echo -e $n "[\033[1;32m$OPER_HOST\033[0;37m] -> $c"
517 if [ ! "$cc" ] ; then
522 echo "Enter Opers Type [Avaliable: NetAdmin, GlobalOp, LocalOp and Helper] CHOOSE ONLY ONE"
523 echo -e $n "[\033[1;32m$OPER_TYPE\033[0;37m] -> $c"
525 if [ ! "$cc" ] ; then
530 echo "Coming for a re-run"
532 echo "<oper name=\"$OPER_LOGIN\"" >> $TEMP
533 echo " password=\"$OPER_PASS\"" >> $TEMP
534 echo " host=\"$OPER_HOST\"" >> $TEMP
535 echo " type=\"$OPER_TYPE\">" >> $TEMP
543 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
544 echo "# You should know what to do here.. if not.. RTFM!! muahahahahaha #" >> $TEMP
546 echo "<die value=\"And god came down from the heavens and smote down the noob.\">" >> $TEMP
552 echo "Congratulations, Your Opers are configured!"
555 echo "Right, i have guessed where you Message of the Day and Rules Files will be."
556 echo "If these are correct, just hit return, else, type in the correct Location."
558 echo "First The Message of the day."
559 echo -e $n "[\033[1;32m$FILES_MOTD\033[0;37m] -> $c"
565 echo "Right, now the Rules file."
566 echo -e $n "[\033[1;32m$FILES_RULE\033[0;37m] -> $c"
572 echo "#-#-#-#-#-#-#-#-#-#- MISCELLANEOUS CONFIGURATION -#-#-#-#-#-#-#-#-#-" >> $TEMP
573 echo "<files motd=\"$FILES_MOTD\"" >> $TEMP
574 echo " rules=\"$FILES_RULE\">" >> $TEMP
581 echo "Enter the Names of the modules you wish to load, one at a time, below."
582 echo "Type in the name, hit return, type in another one, etc. Once complete, just hit return to end."
584 echo "The Following Modules are avaliable:"
587 for module in src/modules/*.cpp ; do
588 desc=`grep '$ModDesc:' $module | sed 's/\/\* $ModDesc://' | sed 's/\*\///'`
589 mod=`echo $module | sed 's/.cpp/.so/' | sed 's/src\/modules\///'`
590 echo -e "\033[1;32m$mod\t\t\033[0;37m$desc"
598 echo "#-#-#-#-#-#-#-#-#-#-#-#-#- MODULE OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
604 while [ "$ok" -eq 0 ] ; do
608 echo "<module name=\"$cc\">" >> $TEMP
619 echo "This is it, The final set of Variables.. Then your config is complete."
622 echo "These are just a few tiny Simple things, well explained.. BEGIN!"
624 echo "Quit Prefix, This comes before all users Quits, it can be what you like."
625 echo -e $n "[\033[1;32m$OP_PREFIX\033[0;37m] -> $c"
632 echo "Maximum Number of results for a /who (Between 1 and 65535) Default 128."
633 echo -e $n "[\033[1;32m$OP_MAWHO\033[0;37m] -> $c"
644 echo "Log level [debug, verbose, default, sparse, none]"
645 echo -e $n "[\033[1;32m$OP_DEBUG\033[0;37m] -> $c"
652 echo "Enable Halfops [Channel Mode +h], [yes/no]"
653 echo -e $n "[\033[1;32m$OP_HALFY\033[0;37m] -> $c"
660 echo "Enable User Channel Protection [Channel Mode +a] [yes/no]"
661 echo -e $n "[\033[1;32m$OP_PROTE\033[0;37m] -> $c"
668 echo "Enable Channel Founder? [Channel Mode +q] [yes/no]"
669 echo -e $n "[\033[1;32m$OP_FOUND\033[0;37m] -> $c"
675 echo "#-#-#-#-#-#-#-#-#-#-#-#-#- SERVER OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
676 echo "<options prefixquit=\"$OP_PREFIX\"" >> $TEMP
677 echo " loglevel=\"$OP_DEBUG\"" >> $TEMP
678 echo " allowhalfop=\"$OP_HALFY\"" >> $TEMP
679 echo " allowprotect=\"$OP_PROTE\"" >> $TEMP
680 echo " allowfounder=\"$OP_FOUND\">" >> $TEMP
681 echo " maxwho=\"$OP_MAWHO\">" >> $TEMP
686 DIR=$ME/conf/inspircd.conf
688 echo "LAST QUESTION!!"
689 echo "Where am i gonna be placed? [eg. $DIR]"
690 echo -e $n "[\033[1;32m$DIR\033[0;37m] -> $c"
696 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- YAWN -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
698 echo "# You should already know what to do here :) #" >> $TEMP
700 echo "<die value=\"All l33t noobs must edit their configs.\">" >> $TEMP
703 echo "#########################################################################" >> $TEMP
705 echo "# -InspIRCd Development and Coding Team- #" >> $TEMP
706 echo "# www.inspircd.org #" >> $TEMP
708 echo "#########################################################################" >> $TEMP