]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - makeconf
Added support for changing of text within OnUserPreNotice and OnUserPreMessage (requi...
[user/henk/code/inspircd.git] / makeconf
1 #!/bin/sh
2 # InspIRCd Configuration Creator
3 #
4 # Copyright 2003 The ChatSpike Development Team
5 # <Craig@chatspike.net>
6 # <brain@chatspike.net>
7 #
8 # $Id$
9 #
10 ########################################################
11
12 echo "Configuring Default Values"
13
14 ME=`pwd`
15 TEMP="$ME/makeconf.temp"
16 SERV_NAME="my.server.name"
17 SERV_DESC="My InspIRCd Server"
18 SERV_NET="MyNetwork"
19
20 ADMIN_NAME="My Name"
21 ADMIN_NICK="MyNick"
22 ADMIN_MAIL="My@E-Mail.Address"
23
24 DIE_PASS="DieNow"
25 RESTART_PASS="RestartNow"
26 DIE_WAIT="5"
27
28 CONNECT_ALLOW="*"
29 CONNECT_PASS="ServerPass"
30
31 VHOST_DOMAIN="inspircd.org"
32
33 OPER_NICK="Fred"
34 OPER_PASS="mysecret"
35 OPER_HOST="*@*"
36 OPER_TYPE="NetAdmin"
37
38 FILES_MOTD="$ME/conf/inspire.motd"
39 FILES_RULE="$ME/conf/inspire.rules"
40
41 OP_PREFIX="Quit: "
42 OP_DEBUG="default"
43 OP_HALFY="yes"
44 OP_PROTE="yes"
45 OP_FOUND="yes"
46 OP_MAWHO="128"
47
48 rm -f $TEMP
49
50 c=""
51 n=""
52
53 if [ "`eval echo -n 'a'`" = "-n a" ] ; then
54         c="\c"
55  else
56         n="-n"
57 fi
58
59 clear
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....::..::::..:::......:::..:::::::::....::..:::::..:::......:::........:::"
68 echo ""
69 echo -e "\033[1;37mWelcome to the inspircd.conf file maker!!"
70 echo -e "\033[0;37m"
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   ***"
76
77 echo ""
78 echo ""
79
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"
83
84 echo ""
85 echo "Enter Servers Name"
86 echo -e $n "[\033[1;32m$SERV_NAME\033[0;37m] -> $c"
87 read cc
88 if [ "$cc" ] ; then
89         SERV_NAME=$cc
90 fi
91
92
93 echo ""
94 echo "Enter Server Description"
95 echo -e $n "[\033[1;32m$SERV_DESC\033[0;37m] -> $c"
96 read cc
97 if [ "$cc" ] ; then
98         SERV_DESC=$cc
99 fi
100
101
102 echo ""
103 echo "Enter Your Network Name"
104 echo -e $n "[\033[1;32m$SERV_NET\033[0;37m] -> $c"
105 read cc
106 if [ "$cc" ] ; then
107         SERV_NET=$cc
108 fi
109
110
111 echo ""
112 echo ""
113
114 echo ""
115 echo "Enter Administrators Full Name"
116 echo -e $n "[\033[1;32m$ADMIN_NAME\033[0;37m] -> $c"
117 read cc
118 if [ "$cc" ] ; then
119         ADMIN_NAME=$cc
120 fi
121
122
123 echo ""
124 echo "Enter Administrators NickName"
125 echo -e $n "[\033[1;32m$ADMIN_NICK\033[0;37m] -> $c"
126 read cc
127 if [ "$cc" ] ; then
128         ADMIN_NICK=$cc
129 fi
130
131
132 echo ""
133 echo "Enter Administrators Email Address"
134 echo -e $n "[\033[1;32m$ADMIN_MAIL\033[0;37m] -> $c"
135 read cc
136 if [ "$cc" ] ; then
137         ADMIN_MAIL=$cc
138 fi
139
140
141 echo "Section Complete, Writing Config File Header."
142
143 ###
144 # Config file header Here!
145 ###
146
147 echo "########################################################################" >> $TEMP
148 echo "#                                                                      #" >> $TEMP
149 echo "#                     ---------------------------                      #" >> $TEMP
150 echo "#                     InspIRCd Configuration File                      #" >> $TEMP
151 echo "#                     ---------------------------                      #" >> $TEMP
152 echo "#                                                                      #" >> $TEMP
153 echo "##################################||####################################" >> $TEMP
154 echo "                                 #||#" >> $TEMP
155 echo "##################################||####################################" >> $TEMP
156 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
159 echo "#                                                                      #" >> $TEMP
160 echo "#                 Written by      : makeconf (Craig@inspircd.org)      #" >> $TEMP
161 echo "#                                                                      #" >> $TEMP
162 echo "########################################################################" >> $TEMP
163 echo "" >> $TEMP
164 echo "" >> $TEMP
165
166 ###
167 # Complete, server tag now
168 ###
169
170 echo "#-#-#-#-#-#-#-#-#-#-#-#-  SERVER DESCRIPTION  -#-#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
171 echo "<server  name=\"$SERV_NAME\"" >> $TEMP
172 echo "         description=\"$SERV_DESC\"" >> $TEMP
173 echo "         network=\"$SERV_NET\">" >> $TEMP
174 echo "" >> $TEMP
175 echo "" >> $TEMP
176
177 ###
178 # Admin Tag..
179 ###
180
181 echo "#-#-#-#-#-#-#-#-#-#-#-#-   ADMIN INFORMATION   -#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
182 echo "<admin  name=\"$ADMIN_NAME\"" >> $TEMP
183 echo "        nick=\"$ADMIN_NICK\"" >> $TEMP
184 echo "        email=\"$ADMIN_MAIL\">" >> $TEMP
185 echo "" >> $TEMP
186 echo "" >> $TEMP
187
188 ###
189 # Complete.
190 ###
191
192 clear
193 echo "Congratulations, you have successfully Configured your Server and Administrator"
194 echo "Information Correctly. Proceeding to Servers Port Configuration."
195
196 echo ""
197 echo ""
198
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."
202 echo ""
203 echo "To end, either type \"done\" as the IP, or leave the Port Blank."
204 echo ""
205
206 ###
207 # Write Config Header..
208 ###
209
210 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-  RTFM LINE  -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
211 echo "#                                                                     #" >> $TEMP
212 echo "#   Just remove this... Its here to make you read through this file   #" >> $TEMP
213 echo "#   properly after running \"makeconf\"                               #" >> $TEMP
214 echo "" >> $TEMP
215 echo "<die value=\"tut tut, someone didnt check their config file properly\">" >> $TEMP
216 echo "" >> $TEMP
217 echo "" >> $TEMP
218
219
220 echo "#-#-#-#-#-#-#-#-#-#-#-#-   PORT CONFIGURATION   -#-#-#-#-#-#-#-#-#-#-#-" >> $TEMP
221
222 ###
223 # Ok, done.. Proceed :)
224 ###
225
226 BOUND_PORT=""
227 ok=0
228 default=0
229 while [ $ok -eq 0 ] ; do
230         echo "Enter the IP"
231         echo $n "[] -> $c"
232         read cc
233         if [ "$cc" == "done" ] ; then
234                 ok=1
235         else
236                 BIND_IP=$cc
237         fi
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"
241                 echo $n "[] -> $c"
242                 read cc
243                 if [ ! "$cc" ] ; then
244                         ok=1
245                 else
246                         default=1
247                         BOUND_PORT="$BOUND_PORT $cc"
248                         echo "<bind address=\"$BIND_IP\" port=\"$cc\">" >> $TEMP
249                 fi
250         fi
251 done
252
253 if [ "$default" == "0" ] ; then 
254         echo "<bind address=\"\" port=\"6667\">" >> $TEMP
255 fi
256
257 ###
258 # OoOok.. Finishing section
259 ###
260
261 echo "" >> $TEMP
262 echo "" >> $TEMP
263
264 ###
265 # Finished, Port Configuration Complete :D
266 ###
267
268
269 clear
270 if [ "$default" == "0" ] ; then
271         echo "<bind address=\"\" port=\"6667\">" >> $TEMP
272         echo ""
273         echo ""
274 fi
275 echo "See? that wasnt so hard, The next bit is easier, just more important."
276
277 echo ""
278 echo ""
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."
282 ok=0
283 while [ $ok -eq 0 ] ; do
284         echo ""
285         echo "Enter the password to Kill the IRCd"
286         echo -e $n "[\033[1;32m$DIE_PASS\033[0;37m] -> $c"
287         read cc
288         if [ ! "$cc" ] ; then
289                 echo ""
290                 echo "You _MUST_ specify your Own Password, try again."
291         else
292                 DIE_PASS=$cc
293                 ok=1
294         fi
295 done
296
297 echo ""
298 echo ""
299 ok=0
300 while [ $ok -eq 0 ] ; do
301         echo ""
302         echo "Now Enter the Password you will use to Restart."
303         echo -e $n "[\033[1;32m$RESTART_PASS\033[0;37m] -> $c"
304         read cc
305         if [ ! "$cc" ] ; then
306                 echo ""
307                 echo "You _MUST_ specify your Own Password, try again."
308         else
309                 RESTART_PASS=$cc
310                 ok=1
311         fi
312 done
313
314 echo ""
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" 
317 read cc
318 if [ "$cc" ] ; then
319         DIE_WAIT=$cc
320 fi
321
322 ###
323 # Now Write the config.. What phun
324 ###
325
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
330 echo "" >> $TEMP
331 echo "" >> $TEMP
332
333 ###
334 # <Insert done comment here>
335 ###
336 clear
337 echo "ok, seeing as we managed that, we have to Arrange a list of people allowed to connect :)"
338 echo ""
339 echo ""
340
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"
344 echo "any passwords"
345 echo ""
346
347
348 ###
349 # Just another Friendly Header :p
350 ###
351
352 echo "#-#-#-#-#-#-#-#-#-#-  CONNECTIONS CONFIGURATION   -#-#-#-#-#-#-#-#-#-#-" >> $TEMP
353
354 ok=0
355 default=0
356
357 while [ $ok -eq 0 ] ; do 
358        echo "" 
359        echo "Enter The IP Address" 
360        echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c" 
361        read cc 
362        if [ "$cc" == "done" ] ; then 
363                ok=1 
364        elif [ ! "$cc" ] ; then 
365                ok=1 
366        else 
367                ALLOW_IP=$cc 
368        fi 
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"
376                read cc
377                if [ ! "$cc" ] ; then
378                 TIMEOUT = "90"
379                else
380                 TIMEOUT = $cc
381                fi
382                echo "Enter Password [If Applicable]" 
383                echo $n "[] -> $c" 
384                read cc 
385                if [ ! "$cc" ] ; then
386                default=1 
387                        echo "<connect allow=\"$ALLOW_IP\" timeout=\"$TIMEOUT\">" >> $TEMP 
388                else 
389                        echo "<connect allow=\"$ALLOW_IP\" password=\"$cc\" timeout=\"$TIMEOUT\>" >> $TEMP 
390                fi 
391        fi 
392 done 
393 if [ "$default" == "0" ] ; then
394          echo "<connect allow=\"*\">" >> $TEMP
395 fi
396
397 ###
398 # Insert Line Break before deny
399 ###
400
401 echo "" >> $TEMP
402
403
404 ###
405 # Another part done
406 ###
407
408 if [ "$default" == "0" ] ; then 
409         echo "No allow lines Specified, using defaults."
410 fi
411 echo ""
412 echo ""
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"
415 echo ""
416 echo "Enter the IP Address"
417 ok=0
418 while [ $ok -eq 0 ] ; do
419         echo -e $n "[\033[1;32m$CONNECT_ALLOW\033[0;37m] -> $c"
420         read cc
421         if [ "$cc" == "done" ] ; then
422                 ok=1
423         elif [ ! "$cc" ] ; then
424                 ok=1
425         else
426                echo "<connect deny=\"$cc\">" >> $TEMP
427         fi
428 done
429
430 ###
431 # Footer Now
432 ###
433
434 echo "" >> $TEMP
435 echo "" >> $TEMP
436
437 clear
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."
441
442 echo ""
443 echo ""
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"
447 read cc
448 if [ "$cc" ] ; then
449         VHOST_DOMAIN=$cc
450 fi
451
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
458 echo "" >> $TEMP
459 echo "" >> $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
465 echo "" >> $TEMP
466 echo "" >> $TEMP
467 clear
468 echo "Yay, now comes the fun Part, time to specify Opers."
469
470 echo ""
471 echo ""
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\""
477 echo ""
478 echo "You may re-configure the classes later, and if you enter nothing for part one, we will proceed to the next step"
479
480
481 ###
482 # Stolen another few lines >;)
483 ###
484
485 echo "#-#-#-#-#-#-#-#-#-#-#-  OPERATOR CONFIGURATION   -#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
486
487 ###
488 # Done :p
489 ###
490
491 ok=0
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"
495         read cc
496         if [ ! "$cc" ] ; then
497                 ok=1
498         else
499                 OPER_LOGIN=$cc
500         fi
501         if [ $ok -eq 0 ] ; then
502                 ok2=0
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"
506                 read cc
507                 if [ ! "$cc" ] ; then
508                         echo "You _MUST_ Enter a password"
509                 else
510                         OPER_PASS=$cc
511                         ok2=1
512                 fi
513                 done
514                 echo "Enter Opers Host [Format User@host]"
515                 echo -e $n "[\033[1;32m$OPER_HOST\033[0;37m] -> $c"
516                 read cc
517                 if [ ! "$cc" ] ; then
518                         OPER_HOST=$OPER_HOST
519                 else
520                         OPER_HOST=$cc
521                 fi
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"
524                 read cc
525                 if [ ! "$cc" ] ; then
526                         OPER_TYPE=$OPER_TYPE
527                 else
528                         OPER_TYPE=$cc
529                 fi
530                 echo "Coming for a re-run"
531
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
536
537         fi
538 done
539
540 echo "" >> $TEMP
541 echo "" >> $TEMP
542
543 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-  RTFM LINE  -#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
544 echo "# You should know what to do here.. if not.. RTFM!! muahahahahaha     #" >> $TEMP
545 echo "" >> $TEMP
546 echo "<die value=\"And god came down from the heavens and smote down the noob.\">" >> $TEMP
547 echo "" >> $TEMP
548 echo "" >> $TEMP
549
550
551 clear
552 echo "Congratulations, Your Opers are configured!"
553 echo ""
554 echo ""
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."
557 echo ""
558 echo "First The Message of the day."
559 echo -e $n "[\033[1;32m$FILES_MOTD\033[0;37m] -> $c"
560 read cc
561 if [ "$cc" ] ; then
562         FILES_MOTD=$cc
563 fi
564 echo ""
565 echo "Right, now the Rules file."
566 echo -e $n "[\033[1;32m$FILES_RULE\033[0;37m] -> $c"
567 read cc
568 if [ "$cc" ] ; then
569         FILES_RULE=$cc
570 fi
571
572 echo "#-#-#-#-#-#-#-#-#-#-  MISCELLANEOUS CONFIGURATION   -#-#-#-#-#-#-#-#-#-" >> $TEMP
573 echo "<files  motd=\"$FILES_MOTD\"" >> $TEMP
574 echo "        rules=\"$FILES_RULE\">" >> $TEMP
575 echo "" >> $TEMP
576 echo "" >> $TEMP
577 clear
578 echo "Module Time!!"
579 echo ""
580 echo ""
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."
583 echo ""
584 echo "The Following Modules are avaliable:"
585 echo ""
586 MODLINE=""
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"
591 done
592 echo ""
593
594 ###
595 # Module Header :p
596 ###
597
598 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-  MODULE OPTIONS   -#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
599
600 ###
601 # End header
602 ###
603 ok=0
604 while [ "$ok" -eq 0 ] ; do
605 echo $n "[] -> $c"
606 read cc
607 if [ "$cc" ] ; then
608         echo "<module name=\"$cc\">" >> $TEMP
609 else
610         ok=1
611 fi
612 done
613
614 echo "" >> $TEMP
615 echo "" >> $TEMP
616
617 clear
618
619 echo "This is it, The final set of Variables.. Then your config is complete."
620 echo ""
621 echo ""
622 echo "These are just a few tiny Simple things, well explained.. BEGIN!"
623 echo ""
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"
626 read cc
627 if [ $cc ] ; then
628         OP_PREFIX=$cc
629 fi
630
631 echo ""
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"
634 if [ -z $cc ] ; then
635         cc=$OP_MAWHO
636 fi
637 case "$cc" in
638         ([0-9]*)
639                 OP_MAWHO=$cc
640                 ;;
641 esac
642
643 echo ""
644 echo "Log level [debug, verbose, default, sparse, none]"
645 echo -e $n "[\033[1;32m$OP_DEBUG\033[0;37m] -> $c"
646 read cc
647 if [ "$cc" ] ; then
648         OP_DEBUG=$cc
649 fi
650  
651 echo ""
652 echo "Enable Halfops [Channel Mode +h], [yes/no]"
653 echo -e $n "[\033[1;32m$OP_HALFY\033[0;37m] -> $c"
654 read cc
655 if [ "$cc" ] ; then
656         OP_HALFY=$cc
657 fi
658
659 echo ""
660 echo "Enable User Channel Protection [Channel Mode +a] [yes/no]"
661 echo -e $n "[\033[1;32m$OP_PROTE\033[0;37m] -> $c"
662 read cc
663 if [ "$cc" ] ; then
664         OP_PROTE=$cc
665 fi
666
667 echo ""
668 echo "Enable Channel Founder? [Channel Mode +q] [yes/no]"
669 echo -e $n "[\033[1;32m$OP_FOUND\033[0;37m] -> $c"
670 read cc
671 if [ "$cc" ] ; then
672         OP_FOUND=$cc
673 fi
674
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
682 echo "" >> $TEMP
683 echo "" >> $TEMP
684
685 ME=`pwd`
686 DIR=$ME/conf/inspircd.conf
687 echo ""
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"
691 read cc
692 if [ "$cc" ] ; then
693  DIR=$cc
694 fi
695
696 echo "#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- YAWN  -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#" >> $TEMP
697 echo "#                                                                     #" >> $TEMP
698 echo "#   You should already know what to do here :)                        #" >> $TEMP
699 echo "" >> $TEMP
700 echo "<die value=\"All l33t noobs must edit their configs.\">" >> $TEMP
701 echo "" >> $TEMP
702 echo "" >> $TEMP
703 echo "#########################################################################" >> $TEMP
704 echo "#                                                                       #" >> $TEMP
705 echo "#                -InspIRCd Development and Coding Team-                 #" >> $TEMP
706 echo "#                          www.inspircd.org                             #" >> $TEMP
707 echo "#                                                                       #" >> $TEMP
708 echo "#########################################################################" >> $TEMP
709
710 mv $TEMP $DIR
711 echo -e "Complete."