This file is indexed.

postinst is in nas 1.9.4-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh -e

CONF=/etc/nas/nasd.conf
CONFEG=/usr/share/nas/nasd.conf.eg

# Source debconf library.
. /usr/share/debconf/confmodule
db_version 2.0

set_var ()
{
	if [ ! -f $CONF ] ; then
		cp $CONFEG $CONF
	fi

	NAME=$1
	VALUE=$2

#	echo "Setting $NAME to $VALUE" >/dev/stderr

	sed "s/^[[:space:]\#]*$NAME.*/$NAME \"$VALUE\"/g" $CONF >$CONF.tmp
	mv $CONF.tmp $CONF
}

case "$1" in
	configure)

		# Install us in init.d
		update-rc.d nas defaults >/dev/null

		# Grab config stuff from debconf
		db_get nas/relinquish
		if [ "$RET" = "true" ] ; then
			set_var ReleaseDevice yes
		else
			set_var ReleaseDevice no
		fi

		db_get nas/mixer
		if [ "$RET" = "true" ] ; then
			set_var MixerInit yes
		else
			set_var MixerInit no
		fi

		# Start up NAS
        if which invoke-rc.d >/dev/null 2>&1; then
            invoke-rc.d nas start
        else
            /etc/init.d/nas start
        fi

		db_stop
	;;
	
	abort-upgrade|abort-remove|abort-deconfigure)

		# Restart NAS
        if which invoke-rc.d >/dev/null 2>&1; then
            invoke-rc.d nas start
        else
            /etc/init.d/nas start
        fi
	;;

esac