Import Debian changes 1.8.5-1
[hcoop/debian/openafs.git] / debian / openafs-client.config
1 #!/bin/sh
2
3 set -e
4
5 . /usr/share/debconf/confmodule
6 db_version 2.0
7
8 # Configure the client cell. Default to the current ThisCell file and,
9 # failing that, the lowercased local domain name, if available. Ignore errors
10 # on read, since it may fail if there's no newline in the file.
11 if [ -r /etc/openafs/ThisCell ] ; then
12 read cell < /etc/openafs/ThisCell || true
13 db_set openafs-client/thiscell "$cell"
14 fi
15 db_get openafs-client/thiscell || true
16 if [ "x$RET" = "x" ] ; then
17 domain=`dnsdomainname 2>/dev/null || true`
18 if [ -n "$domain" ] ; then
19 db_set openafs-client/thiscell `echo "$domain" | tr 'A-Z' 'a-z'`
20 fi
21 fi
22 db_input high openafs-client/thiscell || true
23
24 # Configure the cache size. Default to the current value in the cacheinfo
25 # configuration file.
26 if [ -r /etc/openafs/cacheinfo ] ; then
27 IFS=: read mountpoint cachedir cachesize < /etc/openafs/cacheinfo
28 db_set openafs-client/cachesize "$cachesize"
29 fi
30 db_input high openafs-client/cachesize || true
31 db_go
32
33 # Configure the AFS client parameters set in /etc/openafs/afs.conf, taking
34 # defaults from the current file.
35 test -f /etc/openafs/afs.conf && . /etc/openafs/afs.conf
36 if [ "x$AFS_CLIENT" != "x" ] ; then
37 db_set openafs-client/run-client "$AFS_CLIENT"
38 fi
39 db_input low openafs-client/run-client || true
40 if [ "x$AFS_AFSDB" != "x" ] ; then
41 db_set openafs-client/afsdb "$AFS_AFSDB"
42 fi
43 if [ "x$AFS_CRYPT" != "x" ] ; then
44 db_set openafs-client/crypt "$AFS_CRYPT"
45 fi
46 if [ "x$AFS_DYNROOT" != "x" ] ; then
47 if [ "x$AFS_DYNROOT" = 'xtrue' ] ; then
48 AFS_DYNROOT=Yes
49 elif [ "x$AFS_DYNROOT" = 'xfalse' ] ; then
50 AFS_DYNROOT=No
51 fi
52 db_set openafs-client/dynroot "$AFS_DYNROOT"
53 fi
54 if [ "x$AFS_FAKESTAT" != "x" ] ; then
55 db_set openafs-client/fakestat "$AFS_FAKESTAT"
56 fi
57 db_beginblock
58 db_input low openafs-client/afsdb || true
59 db_input low openafs-client/crypt || true
60 db_input medium openafs-client/dynroot || true
61 db_input low openafs-client/fakestat || true
62 db_endblock
63 db_go