~ubuntu-branches/ubuntu/quantal/hesiod/quantal

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh -e

# Source debconf library.
. /usr/share/debconf/confmodule

db_version 2.0
db_get hesiod/rhs
rhs="$RET"
db_get hesiod/lhs
lhs="$RET"
db_get hesiod/classes
classes="$RET"

hesconf=/etc/hesiod.conf

if test "$1" = configure -a -z "$2"; then
# If we don't have a hesiod.conf file yet, go ahead and populate it.
  if [ ! -f $hesconf ]; then
    echo "# This file determines the behavior of the Hesiod library." > $hesconf
    echo >> $hesconf
    echo "# This line should pretty much always be the same, unless you have a" >> $hesconf
    echo "# funny environment." >> $hesconf
    echo "lhs=$lhs" >> $hesconf
    echo >> $hesconf
    echo "# This determines the Hesiod domain.  You must specify an rhs line." >> $hesconf
    echo "rhs=$rhs" >> $hesconf
    echo >> $hesconf
    echo "# This line specifies the class search order.  You can reverse the" >> $hesconf
    echo "# order or leave out IN or HS if you want.  Don't add spaces after the" >> $hesconf
    echo "# beginning of the value." >> $hesconf
    echo "classes=$classes" >> $hesconf
  else
    sed -e "s/^lhs=.*/lhs=$lhs/" \
	-e "s/^rhs=.*/rhs=$rhs/" \
	-e "s/^classes=.*/classes=$classes/" \
	-i $hesconf
  fi
fi

#DEBHELPER#

exit 0