#!/bin/sh

set -e

if [ $1 = "purge" ]; then
	if [ -L /dev/sndstat ]; then
		rm -f /dev/sndstat
		echo "Remaking /dev/sndstat as char special."
		cd /dev && /bin/mknod sndstat c 14 6
	fi
	if [ -d /etc/sound ]; then 
		rmdir /etc/sound 2> /dev/null || true
	fi
    if [ -x /usr/sbin/update-devfsd ]; then
		/usr/sbin/update-devfsd >&2
	fi
	if [ -f /etc/alsa/alsa-base.conf ]; then
		rm -f /etc/alsa/alsa-base.conf
	fi
	if [ -f /etc/default/alsa ]; then
		rm -f /etc/default/alsa
	fi
fi

# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section
# Automatically added by dh_installinit
if [ "$1" = "purge" ] ; then
	update-rc.d alsa remove >/dev/null
fi
# End automatically added section


