File: postinst.mod

package info (click to toggle)
alsadriver 0.4.1i-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,256 kB
  • ctags: 15,024
  • sloc: ansic: 96,846; makefile: 1,232; sh: 1,051; perl: 54
file content (61 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download
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
#!/bin/bash

set -e

function start()
{

 kver=`uname -a | cut -d' ' -f 3`
 insver=`echo $0 | sed -e 's/.*-//' -e 's/\.postinst//'`

 if [ "$kver" == "$insver" ]; then
   /etc/init.d/alsa start
 fi
}

case "$1" in
	configure)
		# continue as normal
		;;
	abort-upgrade|abort-remove|abort-deconfigure)
		exit 0;
	;;
	*)
		echo "postinst called with unknown argument \`$1'" >&2;
		exit 0;
	;;
esac

depmod -a
update-modules

if [ -s /etc/modutils/alsa ]; then
#	echo "It looks like you have already configured ALSA."
#	echo "You can reconfigure ALSA card by running alsaconf."
#	echo ""
	start || true
	exit 0
fi


if [ -x /usr/sbin/alsaconf ]; then
 echo "It looks like you have installed alsaconf package."
 echo "This can configure ALSA card easily."
 echo -n "Would you like to configure ALSA now? (y/n) [y] "
 read REPLY


 if [ "$REPLY" = "n" -o "$REPLY" = "N" ]; then
	echo ""
	echo "Please run /usr/sbin/alsaconf to configure ALSA at a later time.."  
	echo ""
	start || true
	exit 0
 fi

 if /usr/sbin/alsaconf ; then
	depmod -a
	start
 fi
fi