1
--- maradns-1.2.12.02/tools/maraconf.sh 2006-08-14 15:02:08.000000000 -0500
2
+++ maradns-1.2.12.03/tools/maraconf.sh 2006-08-26 10:57:00.000000000 -0500
5
#################################################################
6
# MaraConf - The MaraDNS Configurator #
7
-# Written by: Daniel Zilli (zilli.daniel@gmail.com) with a big #
8
-# help from Sam Trenholme. #
9
+# Written by: Daniel Zilli (zilli.daniel@gmail.com) with help #
10
+# from Sam Trenholme. #
11
# License: BSD - http://www.maradns.org/license.html #
13
-# v1.2.00 beta04 - 04/08/2006 #
14
+# v1.2.12.03 - 17/08/2006 #
19
+# - I cleaned up andimproved all the code. Especially #
20
+# all the questions. #
21
+# - First public stable release. #
24
+# - All questions are treated now. #
25
+# - Fixed some loops. #
26
+# - Made the trapping function. #
27
+# - I think that "finished" the script. Now I will do some #
28
+# final tests and waiting the community feedback. #
29
+# - Made the confirm's functions better. #
30
+# - Added a function to configure your resolv.conf file in #
31
+# recursive mode...if you want, of course. #
32
+# - Maraconf now has a man-page. :-) #
33
+# - This is my last beta, so I will be careful. #
36
# - Explained what happens when you cancel the program. #
37
-# - Authoritative mode is working. Is test time! #
38
+# - Authoritative mode is working. Is test time! #
41
# - Made the maraconf arguments Gnu/Linux "standart". #
43
# - First beta release. #
44
#################################################################
46
-trap "echo \"For some reason, you canceled the program and lost your confs!\" ; exit" 2 3
47
+trap trapping 1 2 3 6
51
+ echo "For some reason, you canceled the program. You have lost your changes"
58
+read -p "Would you like to configure your /etc/resolv.conf ? (y/n) " YN
61
+ if [ -e /etc/resolv.conf ] ; then
62
+ BACKUP=resolv.conf.backup
63
+ cp /etc/resolv.conf /etc/$BACKUP
64
+ echo Current /etc/resolv.conf copied to /etc/$BACKUP
66
+ echo "nameserver $IPADD" > /etc/resolv.conf
70
+ echo "Don't forget to put the IP $IPADD in your /etc/resolv.conf file"
80
-# Let's decide with we copy the file to /etc or not.
82
if [ -e /etc/$MARARC ] ; then
83
echo -e "WARNING: /etc/$MARARC already exists; while this script"
85
echo -e "will change if you select 'y'."
88
-echo -e "Would like to copy the created mararc file to /etc? (y/n)"
90
-if [ "$YN" = "y" ] || [ "$YN" = "Y" ]; then
91
- if [ -e /etc/$MARARC ] ; then
92
- BACKUP=$MARARC.$( date +%s )
93
- cp /etc/$MARARC /etc/$BACKUP
94
- echo Current /etc/$MARARC copied to /etc/$BACKUP
96
- cp -a $TMP/$MARARC /etc/
99
- echo "Your mararc file is in $TMP"
102
+read -p "Would like to copy the created mararc file to /etc? (y/n) " YN
105
+ if [ -e /etc/$MARARC ] ; then
106
+ BACKUP=$MARARC.$( date +%s )
107
+ cp /etc/$MARARC /etc/$BACKUP
108
+ echo Current /etc/$MARARC copied to /etc/$BACKUP
110
+ cp -a $TMP/$MARARC /etc/
115
+ echo "Your mararc file is in $TMP"
126
if [ -e /etc/maradns/db.$DOMAIN ] ; then
128
echo -e "WARNING: /etc/maradns/db.$DOMAIN already exists;"
129
- echo -e "while this script will backup it, the contents"
130
+ echo -e "while this script will back it up, the contents"
131
echo -e "of this file will change if you select 'y'."
134
-echo -e "Would like to copy the db.$DOMAIN file to /etc/maradns? (y/n)"
136
-if [ "$YN" = "y" ] || [ "$YN" = "Y" ]; then
137
- if [ -e /etc/maradns/db.$DOMAIN ] ; then
138
- BACKUP=db.$DOMAIN.$( date +%s )
139
- cp /etc/maradns/db.$DOMAIN /etc/maradns/$BACKUP
140
- echo Current /etc/maradns/db.$DOMAIN copied to /etc/maradns/$BACKUP
142
- cp -a $TMP/tmp_zone /etc/maradns/db.$DOMAIN
145
- mv tmp_zone db.$DOMAIN
147
- echo "Your db.$DOMAIN file is in $TMP"
150
+read -p "Would like to copy the db.$DOMAIN file to /etc/maradns? (y/n) " YN
153
+ if [ -e /etc/maradns/db.$DOMAIN ] ; then
154
+ BACKUP=db.$DOMAIN.$( date +%s )
155
+ cp /etc/maradns/db.$DOMAIN /etc/maradns/$BACKUP
156
+ echo Current /etc/maradns/db.$DOMAIN copied to /etc/maradns/$BACKUP
158
+ cp -a $TMP/tmp_zone /etc/maradns/db.$DOMAIN
162
+ mv tmp_zone db.$DOMAIN
164
+ echo "Your db.$DOMAIN file is in $TMP"
173
#### RECURSIVE QUESTIONS #################
174
@@ -115,60 +172,63 @@
181
-while [ "$INLOOP" == "1" ]; do
183
- echo -e "${DECOLINE}"
184
- echo -e "| MaraConf ${VERSION} |"
185
- echo -e "${DECOLINE}"
186
- echo -e "|- RECURSIVE DNS - easy way"
188
- echo -e "| Enter the address that this DNS server runs on:"
189
- echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
192
- echo -e "| Enter the ip allowed to perform recursive queries:"
193
- echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
197
+echo -e "${DECOLINE}"
198
+echo -e "| MaraConf ${VERSION} |"
199
+echo -e "${DECOLINE}"
200
+echo -e "|-> RECURSIVE DNS -> Easy way"
202
+echo -e "| Enter the address that this DNS server runs on:"
203
+echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
206
+echo -e "| Enter the ip allowed to perform recursive queries:"
207
+echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
211
# Treating the variables.
212
-# Here I delete any blank space that the user typed and fill it with.
213
-# default value when needed.
214
+# Here I delete any blank space that the user typed.
215
+# If needed, default value are filled it.
216
if [ "$IPADD" != "" ]; then
217
- IPADD=`echo ${IPADD// }`
218
+ IPADD=$( echo ${IPADD// } )
223
if [ "$IPREC" != "" ]; then
224
- IPREC=`echo ${IPREC// }`
225
+ IPREC=$( echo ${IPREC// } )
230
-# confirme the values entered.
232
- echo -e "Please confirm the values entered:"
233
- echo -e "Q: Enter the address that this DNS server runs on:"
234
- echo -e "A: $IPADD"
236
- echo -e "Q: Enter the ip allowed to perform recursive queries:"
237
- echo -e "A: $IPREC"
239
- echo -e "Is this the information that you entered? (y/n)"
241
- if [ "$YN" = "y" ] || ["$YN" = "Y" ]
248
+# Confirm the values entered.
249
+# The loop is to ensure that the user will only choose y or n.
250
+while [ -z "$opt" ]; do
252
+echo -e "Please confirm the values entered:"
253
+echo -e "Q: Enter the address that this DNS server runs on:"
256
+echo -e "Q: Enter the ip allowed to perform recursive queries:"
259
+read -p "Is this the information that you entered correct? (y/n) " YN
260
+# we must type something useful.
268
+ *) echo "--> Please type y or n to answer."
275
# Create the mararc file.
276
cat << EOF > $TMP/$MARARC
278
@@ -184,72 +244,67 @@
280
# Calling a function.
287
-while [ "$INLOOP" == "1" ] ; do
289
- echo -e "${DECOLINE}"
290
- echo -e "| MaraConf ${VERSION} |"
291
- echo -e "${DECOLINE}"
292
- echo -e "|- RECURSIVE DNS - hard way"
294
- echo -e "| Enter with the address that this DNS server runs on:"
295
- echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
298
- echo -e "| Enter with the ip allowed to perform recursive queries:"
299
- echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
302
- echo -e "| What is the directory with all of the zone files?"
303
- echo -e "|--type your value or press ENTER to use default (/etc/maradns):"
306
- echo -e "| What is the numeric UID MaraDNS will run as?"
307
- echo -e "|--type your value or press ENTER to use default (99):"
310
- echo -e "| What is the numeric GID MaraDNS will run as?"
311
- echo -e "|--type your value or press ENTER to use default (99):"
314
- echo -e "| Which is the maximum number of threads that MaraDNS is allowed to run?"
315
- echo -e "|--type your value or press ENTER to use default (64):"
318
- echo -e "| Do you want make MaraDNS obscure (for security reason)?"
319
- echo -e " 0) no (default)"
323
- echo -e "| Choose the level of the messages we log to stdout (0,1,2,3)?"
324
- echo -e " 0) No messages except for fatal parsing errors and the legal disclaimer"
325
- echo -e " 1) Only startup messages logged (default)"
326
- echo -e " 2) Error queries logged"
327
- echo -e " 3) All queries logged (but not very verbosely right now)"
330
- echo -e "| Do you want to increase the time to process queries on some slow networks?"
331
- echo -e "|--type your value or press ENTER to use default (2):"
334
- echo -e "| Do you want use other recursive DNS servers?"
335
- echo -e " 0) no (default)"
339
- if [ "$OTREC" == "1" ]; then
340
- echo -e "| Enter the IP address for the other recursive DNS server:"
345
+echo -e "${DECOLINE}"
346
+echo -e "| MaraConf ${VERSION} |"
347
+echo -e "${DECOLINE}"
348
+echo -e "|-> RECURSIVE DNS -> Hard way"
350
+echo -e "| Enter with the address that this DNS server runs on:"
351
+echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
354
+echo -e "| Enter with the ip allowed to perform recursive queries:"
355
+echo -e "|--type your value or press ENTER to use default (127.0.0.1):"
358
+echo -e "| What is the directory with all of the zone files?"
359
+echo -e "|--type your value or press ENTER to use default (/etc/maradns):"
362
+echo -e "| What is the numeric UID MaraDNS will run as?"
363
+echo -e "|--type your value or press ENTER to use default (99):"
366
+echo -e "| What is the numeric GID MaraDNS will run as?"
367
+echo -e "|--type your value or press ENTER to use default (99):"
370
+echo -e "| Which is the maximum number of threads that MaraDNS is allowed to run?"
371
+echo -e "|--type your value or press ENTER to use default (64):"
374
+echo -e "| Do you want make MaraDNS obscure (for security reason)?"
375
+echo -e " 0) no (default)"
379
+echo -e "| Choose the level of the messages we log to stdout (0,1,2,3)?"
380
+echo -e " 0) No messages except for fatal parsing errors and the legal disclaimer"
381
+echo -e " 1) Only start-up messages logged (default)"
382
+echo -e " 2) Error queries logged"
383
+echo -e " 3) All queries logged (but not very verbosely right now)"
386
+echo -e "| Do you want to increase the time to process queries on some slow networks?"
387
+echo -e "|--type your value or press ENTER to use default (2):"
390
+echo -e "| Do you want use other recursive DNS servers?"
391
+echo -e " 0) no (default)"
395
+if [ "$OTREC" == "1" ]; then
396
+ echo -e "| Enter the IP address for the other recursive DNS server:"
401
# Treating the variables.
402
-# Here I delete any blank space that the user typed and fill it with.
403
-# default value when needed.
404
if [ "$IPADD" != "" ]; then
405
IPADD=`echo ${IPADD// }`
407
@@ -307,50 +362,57 @@
408
OTRECIP=`echo ${OTRECIP// }`
410
# Confirm the values entered
412
- echo -e "Please confirm the values entered:"
413
- echo -e "Q: Enter the address that this DNS server runs on:"
414
- echo -e "A: $IPADD"
416
- echo -e "Q: Enter the ip allowed to perform recursive queries:"
417
- echo -e "A: $IPREC"
419
- echo -e "Q: What is the directory with all of the zone files?"
420
- echo -e "A: $CHROOT"
422
- echo -e "Q: What is the numeric UID MaraDNS will run as?"
425
- echo -e "Q: What is the numeric GID MaraDNS will run as?:"
428
- echo -e "Q: Which is the maximum number of threads that MaraDNS is allowed to run?"
431
- echo -e "Q: Do you want make MaraDNS obscure (for security reason)?"
432
- echo -e "A: $NOFING"
434
- echo -e "Q: Choose the level of the messages we log to stdout (0,1,2,3)?"
437
- echo -e "Q: Do you want to increase the time to process queries on some slow networks?"
438
- echo -e "A: $TIMES"
440
- echo -e "Q: Do you want to use other recursive DNS servers?"
441
- if [ "$OTRECIP" != "" ]; then
442
+while [ -z "$opt" ]; do
444
+ echo -e "Please confirm the values entered:"
445
+ echo -e "Q: Enter the address that this DNS server runs on:"
446
+ echo -e "A: $IPADD"
448
+ echo -e "Q: Enter the ip allowed to perform recursive queries:"
449
+ echo -e "A: $IPREC"
451
+ echo -e "Q: What is the directory with all of the zone files?"
452
+ echo -e "A: $CHROOT"
454
+ echo -e "Q: What is the numeric UID MaraDNS will run as?"
457
+ echo -e "Q: What is the numeric GID MaraDNS will run as?:"
460
+ echo -e "Q: Which is the maximum number of threads that MaraDNS is allowed to run?"
463
+ echo -e "Q: Do you want make MaraDNS harder to detect (for security reason)?"
464
+ echo -e "A: $NOFING"
466
+ echo -e "Q: Choose the level of the messages we log to stdout (0,1,2,3)?"
469
+ echo -e "Q: Do you want to increase the time to process queries on some slow networks?"
470
+ echo -e "A: $TIMES"
472
+ echo -e "Q: Do you want to use other recursive DNS servers?"
473
+ if [ "$OTRECIP" != "" ]; then
474
echo -e "A: $OTRECIP"
480
- echo -e -n "Is this the information that you entered correct? (y/n) "
482
- if [ "$YN" = "y" ] || ["$YN" = "Y" ]; then
489
+ read -p "Is this the information that you entered correct? (y/n) " YN
497
+ *) echo "--> Please type y or n to answer."
505
cat << EOF > $TMP/$MARARC
508
if [ "$OTRECIP" != "" ]; then
509
cat << EOF >> $TMP/$MARARC
510
-# Using other recursives servers
511
+# Using others recursive servers.
512
upstream_servers = {}
513
upstream_servers["."] = "$OTRECIP"
515
@@ -394,51 +456,41 @@
517
# Calling a function.
524
-while [ "$RS_INLOOP" == "1" ] ; do
527
echo -e "${DECOLINE}"
528
echo -e "| MaraConf ${VERSION} |"
529
echo -e "${DECOLINE}"
530
- echo -e "|- RECURSIVE DNS"
531
+ echo -e "|-> RECURSIVE DNS"
533
+ echo -e "|- How do you want to setup recursive dns?"
535
- echo -e "|- (How do you want to setup recursive dns?)"
536
echo -e "| 1) The easy way (using a wizard)"
537
echo -e "| 2) The hard way (for experienced users)"
540
echo -n -e "Choose a option [0-2] => "
562
*) echo "Please type in a number between 0 - 2." 1>&2
573
#### AUTHORITATIVE QUESTIONS #################
576
@@ -446,20 +498,230 @@
584
+read -p "| Do you want to setup an A record? (y/n) " YN
588
+ echo -e "| Enter the IP address for the A record"
591
+ IPA=`echo ${IPA// }`
593
+ # Save all the records here.
594
+ echo "$DOMAIN. $IPA" >> $TMP/tmp_zone
597
+ while [ -z "$opt" ] ; do
598
+ read -p "Do you want to setup an other A record? (y/n) " YN
601
+ # Here we go again.
603
+ echo -e "| Enter the IP address for the A record"
606
+ IPA=`echo ${IPA// }`
608
+ # Save all the records here.
609
+ echo "$DOMAIN. $IPA" >> $TMP/tmp_zone
611
+ n|N) break ; opt=ok ;;
612
+ *) echo "--> Please type y or n to answer." ;;
619
+ # Nothing happens here.
622
+ echo "--> Please type y or n to answer."
631
+read -p "| Do you want to setup a NS record? (y/n) " YN
635
+ echo -e "| Enter the IP address for the NS record"
637
+ IPNS=`echo ${IPNS// }`
639
+ echo -e "| Enter with the hostname used with the NS record."
642
+ NS_HOST=`echo ${NS_HOST// }`
644
+ # Save all the records here.
645
+ echo "$DOMAIN. NS $NS_HOST.$DOMAIN." >> $TMP/tmp_zone
646
+ echo "$NS_HOST.$DOMAIN. $IPNS" >> $TMP/tmp_zone
649
+ while [ -z "$opt" ] ; do
650
+ read -p echo -n "Do you want to setup an other NS record? (y/n) " YN
653
+ # Here we go again.
654
+ echo -e "| Enter the IP address for the NS record"
656
+ IPNS=`echo ${IPNS// }`
658
+ echo -e "| Enter with the hostname used with the NS record."
661
+ NS_HOST=`echo ${NS_HOST// }`
663
+ # Save all the records here.
664
+ echo "$DOMAIN. NS $NS_HOST.$DOMAIN." >> $TMP/tmp_zone
665
+ echo "$NS_HOST.$DOMAIN. $IPNS" >> $TMP/tmp_zone
667
+ n|N) break ; opt=ok ;;
668
+ *) echo "--> Please type y or n to answer." ;;
675
+ # Nothing happens here.
678
+ echo "--> Please type y or n to answer."
687
+read -p "| Do you want to setup a MX record? (y/n) " YN
691
+ echo -e "| Enter the IP address for the MX record"
694
+ IPMX=`echo ${IPMX// }`
695
+ echo -e "| Enter with the hostname used with the MX record."
698
+ MX_HOST=`echo ${MX_HOST// }`
700
+ # Save all the records here.
701
+ echo "$DOMAIN. MX 10 $MX_HOST.$DOMAIN." >> $TMP/tmp_zone
702
+ echo "$MX_HOST.$DOMAIN. $IPNS" >> $TMP/tmp_zone
705
+ while [ -z "$opt" ] ; do
706
+ read -p echo -n "Do you want to setup an other MX record? (y/n) " YN
709
+ # Here we go again.
710
+ echo -e "| Enter the IP address for the MX record"
713
+ IPMX=`echo ${IPMX// }`
714
+ echo -e "| Enter with the hostname used with the MX record."
717
+ MX_HOST=`echo ${MX_HOST// }`
719
+ # Save all the records here.
720
+ echo "$DOMAIN. MX 10 $MX_HOST.$DOMAIN." >> $TMP/tmp_zone
721
+ echo "$MX_HOST.$DOMAIN. $IPNS" >> $TMP/tmp_zone
723
+ n|N) break ; opt=ok ;;
724
+ *) echo "--> Please type y or n to answer." ;;
731
+ # Nothing happens here.
734
+ echo "--> Please type y or n to answer."
742
+# Single Names record.
743
+read -p "| Do you want to setup a single name to ip? (y/n) " YN
747
+ echo -e "| Enter with the hostname for the single name."
750
+ SN_HOST=`echo ${SN_HOST// }`
751
+ echo -e "| Enter the IP address for the single name."
754
+ IPSN=`echo ${IPSN// }`
756
+ # Save all the records here.
757
+ echo "$SN_HOST.$DOMAIN. $IPSN" >> $TMP/tmp_zone
760
+ while [ -z "$opt" ] ; do
761
+ read -p "Do you want to setup an other single name? (y/n) " YN
764
+ # Here we go again.
765
+ echo -e "| Enter with the hostname for the single name."
768
+ SN_HOST=`echo ${SN_HOST// }`
769
+ echo -e "| Enter the IP address for the single name."
772
+ IPSN=`echo ${IPSN// }`
774
+ # Save all the records here.
775
+ echo "$SN_HOST.$DOMAIN. $IPSN" >> $TMP/tmp_zone
777
+ n|N) break ; opt=ok ;;
778
+ *) echo "--> Please type y or n to answer." ;;
785
+ # Nothing happens here.
788
+ echo "--> Please type y or n to answer."
794
# Configuring mararc file.
797
-while [ "$INLOOP" == "1" ] ; do
800
echo -e "${DECOLINE}"
801
echo -e "| MaraConf ${VERSION} |"
802
echo -e "${DECOLINE}"
803
- echo -e "|- AUTHORITATIVE DNS - configuring mararc:"
804
+ echo -e "|-> AUTHORITATIVE DNS -> Configuring mararc:"
806
- echo -e "| Enter the address that this DNS server runs on."
807
- echo -e "|--you must type a value, there is no default here:"
808
+ echo -e "| Enter the IP(s) address(es) that this DNS server runs on."
809
+ echo -e "|--you must type the values separate by comma."
812
echo -e "| Enter the domain."
813
@@ -473,24 +735,27 @@
814
IPADD=`echo ${IPADD// }`
815
DOMAIN=`echo ${DOMAIN// }`
817
- # Confirme the values entered
819
- echo -e "Please confirm the values entered:"
820
- echo -e "Q: Enter the address that this DNS server runs on:"
821
- echo -e "A: $IPADD"
823
- echo -e "Q: Enter the domain:"
824
- echo -e "A: $DOMAIN"
826
- echo -e -n "Is this the information that you entered? (y/n) "
828
- if [ "$YN" = "y" ] || ["$YN" = "Y" ]
834
+ # Confirm the values entered.
835
+while [ -z "$opt" ] ; do
837
+ echo -e "Please confirm the values entered:"
838
+ echo -e "Q: Enter the address that this DNS server runs on:"
839
+ echo -e "A: $IPADD"
841
+ echo -e "Q: Enter the domain:"
842
+ echo -e "A: $DOMAIN"
844
+ read -p "Is this the information that you entered correct? (y/n) " YN
850
+ *) echo "--> Please type y or n to answer."
857
cat << EOF > $TMP/$MARARC
858
@@ -512,144 +777,58 @@
860
# Configuring zone file.
864
while [ "$INLOOP" == "1" ] ; do
866
echo -e "${DECOLINE}"
867
echo -e "| MaraConf ${VERSION} |"
868
echo -e "${DECOLINE}"
869
- echo -e "|- AUTHORITATIVE DNS - configuring the zone file:"
870
+ echo -e "|-> AUTHORITATIVE DNS -> Configuring the zone file:"
875
- echo -n "| Do you want to setup an A record? (y/n) "
877
- while [ "$ALOOP" == "1" ] && [ "$YN" = "y" ] || [ "$YN" = "Y" ] ; do
878
- echo -e "| Enter the IP address for the A record"
881
- IPA=`echo ${IPA// }`
882
-# echo -e "| Enter with the hostname used with the A record."
886
- # Save all the records here.
887
- echo "$DOMAIN. $IPA" >> $TMP/tmp_zone
889
- echo -n "Do you want to setup an other A record? (y/n) "
891
- if [ "$YN" = "n" ] || [ "$YN" = "N" ]; then
900
- echo -n "| Do you want to setup a NS record? (y/n) "
902
- while [ "$NSLOOP" == "1" ] && [ "$YN" = "y" ] || [ "$YN" = "Y" ] ; do
903
- echo -e "| Enter the IP address for the NS record"
906
- IPNS=`echo ${IPNS// }`
907
- echo -e "| Enter with the hostname used with the NS record."
910
- NS_HOST=`echo ${NS_HOST// }`
911
- # Save all the records here.
912
- echo "$DOMAIN. NS $NS_HOST.$DOMAIN." >> $TMP/tmp_zone
913
- echo "$NS_HOST.$DOMAIN. $IPNS" >> $TMP/tmp_zone
915
- echo -n "Do you want to setup an other NS record? (y/n) "
917
- if [ "$YN" = "n" ] || [ "$YN" = "N" ]; then
927
- echo -n "| Do you want to setup a MX record? (y/n) "
929
- while [ "$MXLOOP" == "1" ] && [ "$YN" = "y" ] || [ "$YN" = "Y" ] ; do
930
- echo -e "| Enter the IP address for the MX record"
933
- IPMX=`echo ${IPMX// }`
934
- echo -e "| Enter with the hostname used with the MX record."
937
- MX_HOST=`echo ${MX_HOST// }`
939
- # Save all the records here.
940
- echo "$DOMAIN. MX 10 $MX_HOST.$DOMAIN." >> $TMP/tmp_zone
941
- echo "$MX_HOST.$DOMAIN. $IPNS" >> $TMP/tmp_zone
943
- echo -n "Do you want to setup an other MX record? (y/n) "
945
- if [ "$YN" = "n" ] || [ "$YN" = "N" ]; then
954
- echo -n "| Do you want to setup a single name to ip? (y/n) "
956
- while [ "$SNLOOP" == "1" ] && [ "$YN" = "y" ] || [ "$YN" = "Y" ] ; do
957
- echo -e "| Enter with the hostname for the single name."
960
- SN_HOST=`echo ${SN_HOST// }`
961
- echo -e "| Enter the IP address for the single name."
964
- IPSN=`echo ${IPSN// }`
966
- # Save all the records here.
967
- echo "$SN_HOST.$DOMAIN. $IPSN" >> $TMP/tmp_zone
969
- echo -n "Do you want to setup an other single name? (y/n) "
971
- if [ "$YN" = "n" ] || [ "$YN" = "N" ]; then
978
-# confirme the values entered
979
+while [ -z "$opt" ]; do
981
echo -e "Please confirm the values entered:"
982
if [ -f $TMP/tmp_zone ]; then
985
- echo "no zone file created"
986
+ echo "No zone file created, so we exit now."
991
- echo -e -n "Is this the information that you entered? (y/n) "
993
- if [ "$YN" = "y" ] || [ "$YN" = "Y" ]; then
999
+ read -p "Is this the information that you entered correct? (y/n) " YN
1010
+ echo "--> Please type y or n to answer."
1022
-while [ "$ST_INLOOP" == "1" ] ; do
1024
echo -e "${DECOLINE}"
1025
echo -e "| MaraConf ${VERSION} |"
1026
@@ -662,10 +841,10 @@
1029
echo -n -e "Choose a option [0-2] => "
1050
DECOLINE="+--------------------------------+"
1051
-VERSION="v1.2.00 -beta04 "
1052
+VERSION="v1.2.12.03 "
1057
# Calling the function.
1059
@@ -719,13 +897,14 @@
1064
echo "####################################"
1065
echo "# MaraDNS configurator #"
1066
echo "####################################"
1068
- echo "This program is designed to help you setup a recursive and autothirative"
1069
+ echo "This program is designed to help you setup a recursive and authoritative"
1070
echo "DNS servers using MaraDNS. What this script will do is create a mararc"
1071
- echo "file and the respectives zone files for a domain, to be used for the"
1072
+ echo "file and the respective zone files for a domain, to be used for the"
1073
echo "authoritative server. It should work on any Unix-like system that has"
1074
echo "bash in /bin."
1076
@@ -741,14 +920,13 @@
1080
- echo -e "Usage: maraconf OPTION"
1081
+ echo -e "Usage: maraconf OPTIONS"
1084
- echo -e "-s, --start initialize the configuration."
1085
+ echo -e "-s, --start initialize the configurator."
1086
echo -e "-h, --help show a brief explanation."
1088
echo "MaraConf $VERSION"