4bef32204ac3b4c0876eb7ec70a56f8aa675e4c1
[nfs-utils.git] / debian / nfs-kernel-server.postinst
1 #!/bin/sh -e
2
3 #DEBHELPER#
4
5 . /usr/share/debconf/confmodule
6
7 case "$1" in
8     configure)
9         db_get nfs-kernel-server/tcpwrappers-mountd || true
10
11         touch /var/lib/nfs/etab  \
12               /var/lib/nfs/rmtab \
13               /var/lib/nfs/xtab
14
15         if test -s /etc/exports
16         then
17             : do nothing
18         else
19             cat <<EOF >/etc/exports
20 # /etc/exports: the access control list for filesystems which may be exported
21 #               to NFS clients.  See exports(5).
22 EOF
23         fi
24
25         # The old nfs-server's init script can't tell that it's been
26         # removed, so we have to kill the symlinks to it.
27         update-rc.d -f nfs-server remove >/dev/null
28
29         update-rc.d nfs-kernel-server defaults 20 80 >/dev/null
30         ;;
31 esac
32
33 db_stop
34
35 act="restart"
36 [ "$1:$2" = "configure:" ] && act="start"
37 invoke-rc.d nfs-kernel-server $act