]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blob - debian/libhesiod0.postinst
03dc6654b17749f87e415cd703631c1e67ef6071
[1ts-debian.git] / debian / libhesiod0.postinst
1 #!/bin/sh -e
2
3 # Source debconf library.
4 . /usr/share/debconf/confmodule
5
6 db_version 2.0
7 db_get hesiod/rhs
8 rhs="$RET"
9 db_get hesiod/lhs
10 lhs="$RET"
11 db_get hesiod/classes
12 classes="$RET"
13
14 hesconf=/etc/hesiod.conf
15
16 # If we don't have a hesiod.conf file yet, go ahead and populate it.
17 if [ ! -f $hesconf ]; then
18   echo "# This file determines the behavior of the Hesiod library." > $hesconf
19   echo >> $hesconf
20   echo "# This line should pretty much always be the same, unless you have a" >> $hesconf
21   echo "# funny environment." >> $hesconf
22   echo "lhs=$lhs" >> $hesconf
23   echo >> $hesconf
24   echo "# This determines the Hesiod domain.  You must specify an rhs line." >> $hesconf
25   echo "rhs=$rhs" >> $hesconf
26   echo >> $hesconf
27   echo "# This line specifies the class search order.  You can reverse the" >> $hesconf
28   echo "# order or leave out IN or HS if you want.  Don't add spaces after the" >> $hesconf
29   echo "# beginning of the value." >> $hesconf
30   echo "classes=$classes" >> $hesconf
31 else
32   sed -e "s/^lhs=.*/lhs=$lhs/" \
33       -e "s/^rhs=.*/rhs=$rhs/" \
34       -e "s/^classes=.*/classes=$classes/" \
35       < $hesconf > $hesconf.new
36   mv -f $hesconf.new $hesconf
37 fi
38
39 #DEBHELPER#
40
41 exit 0