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