chiark / gitweb /
0.2.99.0.1
[userv-utils.git] / dyndns / install
1 #!/bin/bash
2 set -e
3 zone=$1
4 test -d ../zone,$zone
5
6 ah="`
7         adnshost +Do +Dt -Cf -t soa $zone. || \
8         (test $? == 6 && echo . . 1 0 0 0 0)
9 `"
10 re='.* \([0-9][0-9]*\) [0-9][0-9]* [0-9][0-9]* [0-9][0-9]* [0-9][0-9]*$'
11 serial="`expr 1 + match \"$ah\" \"$re\"`"
12
13 sed <Manual -e 's/^[    ]*%SERIAL[      ]*$/ '" $serial;serial/" >Zone.new
14 cat [_0-9a-z]*,data >>Zone.new
15 mv Zone.new Zone
16
17 echo "serial $serial"
18 userv root ndc-reload