File: nas.postinst

package info (click to toggle)
nas 1.9.4-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 8,140 kB
  • sloc: ansic: 52,109; makefile: 31,375; sh: 8,077; perl: 1,104; yacc: 249; cpp: 216; lex: 68
file content (55 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (4)
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
#!/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

#DEBHELPER#