File: prerm

package info (click to toggle)
oss-compat 8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 52 kB
  • sloc: sh: 56; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
set -e

case "$1" in
    remove)
	conffile=/etc/modprobe.d/oss-compat.conf
	# If the installed file matches a known version, remove it
	if [ -f ${conffile} ]; then
	    md5sum=$(md5sum ${conffile} | cut -d\  -f1)
	    # Wheezy version
	    md5wheezy=88222606b0a3ba8b0825c5000c754e6f
	    # Jessie version
	    md5jessie=cb772524a069ec273d7ca6db520388c1
	    if [ "${md5sum}" = "${md5wheezy}" -o "${md5sum}" = "${md5jessie}" ]; then
		rm -f /etc/modprobe.d/oss-compat.conf
	    fi
	fi
	# Remove the modules once nothing uses them
	for module in $(egrep '^snd_[^ ]*_oss' /proc/modules | cut -d\  -f1); do
	    (while [ -x /sbin/rmmod -a $(grep ^${module} /proc/modules | cut -d\   -f3) != 0 ]; do sleep 10; done; rmmod ${module}) &
	    disown
	done
	;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0