/[fai]/trunk/debian/fai-quickstart.postinst
ViewVC logotype

Contents of /trunk/debian/fai-quickstart.postinst

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6685 - (show annotations) (download)
Tue Oct 11 15:15:13 2011 UTC (19 months, 1 week ago) by mika
File size: 1677 byte(s)
fai-quickstart.postinst: make sure FAI_CONFIGDIR is set, otherwise inform user

Natxo Asenjo stumbled upon this issue and reported it on the FAI
user mailing list. Let's make sure FAI_CONFIGDIR is defined in
/etc/fai/make-fai-nfsroot.conf, otherwise exit with an according
warning message.

From: Michael Prokop <mika@grml.org>
1 #! /bin/sh
2
3 set -e
4
5 # summary of how this script can be called:
6 # * <postinst> `configure' <most-recently-configured-version>
7 # * <old-postinst> `abort-upgrade' <new version>
8 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
9 # <new-version>
10 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
11 # <failed-install-package> <version> `removing'
12 # <conflicting-package> <version>
13 # for details, see http://www.debian.org/doc/debian-policy/ or
14 # the debian-policy package
15 #
16
17 case "$1" in
18 configure)
19
20 # for upgrades from 3.2.20 to newer versions.
21 if egrep -q ^FAI_CONFIGDIR= /etc/fai/fai.conf; then
22 echo "WARNING: The variable \$FAI_CONFIGDIR is still defined in /etc/fai/fai.conf."
23 echo "Please move it to /etc/fai/make-fai-nfsroot.conf."
24 echo "NOT doing any further configuration - please copy your configspace yourself"
25 exit 0
26 fi
27
28 . /etc/fai/make-fai-nfsroot.conf
29
30 if [ -z "$FAI_CONFIGDIR" ] ; then
31 echo "WARNING: \$FAI_CONFIGDIR is NOT defined in /etc/fai/make-fai-nfsroot.conf."
32 echo "NOT doing any further configuration - please copy the configspace yourself"
33 echo "The simple examples are available at /usr/share/doc/fai-doc/examples/simple/"
34 exit 0
35 fi
36
37 if [ ! -d $FAI_CONFIGDIR/class ]; then
38 mkdir -p $FAI_CONFIGDIR
39 cp -a /usr/share/doc/fai-doc/examples/simple/* $FAI_CONFIGDIR
40 echo "Simple examples copied to config space $FAI_CONFIGDIR."
41 fi
42 ;;
43
44 abort-upgrade|abort-remove|abort-deconfigure)
45
46 ;;
47
48 *)
49 echo "postinst called with unknown argument \`$1'" >&2
50 exit 1
51 ;;
52 esac
53
54
55 #DEBHELPER#
56
57 exit 0

  ViewVC Help
Powered by ViewVC 1.1.5