This file is indexed.

postinst is in nas 1.9.4-4.

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
#!/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)

		# 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

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

		# Restart NAS
	;;

esac

# Automatically added by dh_installinit
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
	if [ -x "/etc/init.d/nas" ]; then
		update-rc.d nas defaults >/dev/null
	fi
	if [ -x "/etc/init.d/nas" ] || [ -e "/etc/init/nas.conf" ]; then
		invoke-rc.d nas start || exit $?
	fi
fi
# End automatically added section