Fedora: Handle new kernel variant paths
[openafs.git] / src / packaging / Debian / openafs-client.config
1 #!/bin/sh
2 set -e
3
4 . /usr/share/debconf/confmodule
5
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
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     db_set openafs-client/dynroot "$AFS_DYNROOT"
48 fi
49 if [ "x$AFS_FAKESTAT" != "x" ] ; then
50     db_set openafs-client/fakestat "$AFS_FAKESTAT"
51 fi
52 db_beginblock
53 db_input low openafs-client/afsdb || true
54 db_input low openafs-client/crypt || true
55 db_input medium openafs-client/dynroot || true
56 db_input low openafs-client/fakestat || true
57 db_endblock
58 db_go