equal
deleted
inserted
replaced
1 #!/bin/bash |
1 #!/bin/bash |
2 |
2 |
3 set -e |
3 set -e |
|
4 source dnstools.conf |
4 |
5 |
5 BIND_DIR=/etc/bind |
6 domain="eins.lan" |
|
7 master_dir="$MASTER_DIR" |
|
8 conf_dir="$ZONE_CONF_DIR" |
|
9 bind_dir="$BIND_DIR" |
6 |
10 |
7 cat $BIND_DIR/zones.d/* > $BIND_DIR/named.conf.zones |
11 |
|
12 for zone_domain in $master_dir/* |
|
13 do |
|
14 domain=${zone_domain##/*/} |
|
15 zone_dir="$master_dir/$domain" |
|
16 conf_file="$conf_dir/$domain" |
|
17 zone="$master_dir/$domain/$domain" |
|
18 zone_signed="$master_dir/$domain/$domain.signed" |
|
19 |
|
20 if [ -f $master_dir/$domain/$domain.signed ] # testet ob es eine signed-datei gibt |
|
21 then |
|
22 if ( ! grep "file" $conf_file | grep "signed" ) > /dev/null # testet ob signed nicht in der config-datei steht |
|
23 then |
|
24 cat $conf_file | sed -e "s\\$zone\\$zone_signed\\g" > $conf_file # schreibt signed in die config-datei |
|
25 echo $zone '-->' $zone_signed |
|
26 fi |
|
27 else |
|
28 if ( grep "file" $conf_file | grep "signed" ) # testet ob signed in der config-datei steht |
|
29 then |
|
30 cat $conf_file | sed -e "s\\$zone_signed\\$zone\\g" > $conf_file # schreibt signed in die config-datei |
|
31 echo $zone_signed '-->' $zone |
|
32 fi |
|
33 fi |
|
34 done |
|
35 |
|
36 |
|
37 cat $conf_dir/* > $bind_dir/named.conf.zones |
8 named-checkconf |
38 named-checkconf |
9 named-checkconf -z |
39 named-checkconf -z |
10 rndc reload |
40 rndc reload |