|
6 | 6 |
|
7 | 7 | if [ ! -f /var/cache/bind/$ZONE.zone ]
|
8 | 8 | then
|
9 |
| - echo "creating zone..."; |
10 |
| - cat >> /etc/bind/named.conf <<EOF |
| 9 | + echo "creating zone..."; |
| 10 | + cat >> /etc/bind/named.conf <<EOF |
11 | 11 | zone "$ZONE" {
|
12 |
| - type master; |
13 |
| - file "$ZONE.zone.signed"; |
14 |
| - allow-query { any; }; |
15 |
| - allow-transfer { none; }; |
16 |
| - allow-update { localhost; }; |
| 12 | + type master; |
| 13 | + file "$ZONE.zone.signed"; |
| 14 | + allow-query { any; }; |
| 15 | + allow-transfer { none; }; |
| 16 | + allow-update { localhost; }; |
17 | 17 | };
|
18 | 18 | EOF
|
19 |
| - |
20 |
| - echo "creating zone file..." |
21 |
| - if [ 'z "$NS" ] |
22 |
| - then |
23 |
| - IFS="," read -r -a elements <<< "$NS" |
24 |
| - for element in ${elements[@]} |
25 |
| - do |
26 |
| - SHORT+="${element%%.*}. " |
27 |
| - LONG+="$element. " |
28 |
| - done |
29 |
| - else |
30 |
| - SHORT="${NS%%.*}." |
31 |
| - LONG+="$NS." |
32 |
| - fi |
33 |
| - cat > /var/cache/bind/$ZONE.zone <<EOF |
| 19 | + |
| 20 | + echo "creating zone file..." |
| 21 | + if [ 'z "$NS" ] |
| 22 | + then |
| 23 | + IFS="," read -r -a elements <<< "$NS" |
| 24 | + for element in ${elements[@]} |
| 25 | + do |
| 26 | + SHORT+="${element%%.*}. " |
| 27 | + LONG+="$element. " |
| 28 | + done |
| 29 | + else |
| 30 | + SHORT="${NS%%.*}." |
| 31 | + LONG+="$NS." |
| 32 | + fi |
| 33 | + cat > /var/cache/bind/$ZONE.zone <<EOF |
34 | 34 | \$ORIGIN .
|
35 |
| -\$TTL 86400 ; 1 day |
36 |
| -$ZONE IN SOA $SHORT $LONG ( |
37 |
| - 74 ; serial |
38 |
| - 3600 ; refresh (1 hour) |
39 |
| - 900 ; retry (15 minutes) |
40 |
| - 604800 ; expire (1 week) |
41 |
| - 86400 ; minimum (1 day) |
42 |
| - ) |
43 |
| - NS $SHORT |
| 35 | +\$TTL 86400 ; 1 day |
| 36 | +$ZONE IN SOA $SHORT $LONG ( |
| 37 | + 74 ; serial |
| 38 | + 3600 ; refresh (1 hour) |
| 39 | + 900 ; retry (15 minutes) |
| 40 | + 604800 ; expire (1 week) |
| 41 | + 86400 ; minimum (1 day) |
| 42 | + ) |
| 43 | + NS $SHORT |
44 | 44 | \$ORIGIN ${ZONE}.
|
45 | 45 | \$TTL ${RECORD_TTL}
|
46 | 46 | EOF
|
47 | 47 | fi
|
48 | 48 |
|
49 | 49 | if [ ! -f /etc/dyndns.json ]
|
50 | 50 | then
|
51 |
| - echo "creating REST api config..." |
52 |
| - cat > /etc/dyndns.json <<EOF |
| 51 | + echo "creating REST api config..." |
| 52 | + cat > /etc/dyndns.json <<EOF |
53 | 53 | {
|
54 | 54 | "SharedSecret": "${SHARED_SECRET}",
|
55 | 55 | "Server": "localhost",
|
|
0 commit comments