backport to buster
[hcoop/debian/openafs.git] / debian / openafs-client.config
CommitLineData
b7cfede0
BK
1#!/bin/sh
2
3set -e
4
5. /usr/share/debconf/confmodule
6db_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.
11if [ -r /etc/openafs/ThisCell ] ; then
12 read cell < /etc/openafs/ThisCell || true
13 db_set openafs-client/thiscell "$cell"
14fi
15db_get openafs-client/thiscell || true
16if [ "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
21fi
22db_input high openafs-client/thiscell || true
23
24# Configure the cache size. Default to the current value in the cacheinfo
25# configuration file.
26if [ -r /etc/openafs/cacheinfo ] ; then
27 IFS=: read mountpoint cachedir cachesize < /etc/openafs/cacheinfo
28 db_set openafs-client/cachesize "$cachesize"
29fi
30db_input high openafs-client/cachesize || true
31db_go
32
33# Configure the AFS client parameters set in /etc/openafs/afs.conf, taking
34# defaults from the current file.
35test -f /etc/openafs/afs.conf && . /etc/openafs/afs.conf
36if [ "x$AFS_CLIENT" != "x" ] ; then
37 db_set openafs-client/run-client "$AFS_CLIENT"
38fi
39db_input low openafs-client/run-client || true
40if [ "x$AFS_AFSDB" != "x" ] ; then
41 db_set openafs-client/afsdb "$AFS_AFSDB"
42fi
43if [ "x$AFS_CRYPT" != "x" ] ; then
44 db_set openafs-client/crypt "$AFS_CRYPT"
45fi
46if [ "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"
53fi
54if [ "x$AFS_FAKESTAT" != "x" ] ; then
55 db_set openafs-client/fakestat "$AFS_FAKESTAT"
56fi
57db_beginblock
58db_input low openafs-client/afsdb || true
59db_input low openafs-client/crypt || true
60db_input medium openafs-client/dynroot || true
61db_input low openafs-client/fakestat || true
62db_endblock
63db_go