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

#DEBHELPER#

