#!/bin/bash

case "$1" in
    start)
	if [ -d /dev/dri ]; then
	  chgrp users /dev/dri/*
	  chmod 0660 /dev/dri/*
	fi

	if [ -d /dev/snd ]; then
	  pushd /dev/snd >/dev/null
	  for i in *; do
	    case "$i" in
	    control*|pcm*)
		chmod 660 $i
		chgrp users $i
	    ;;
	    timer*)
		chmod 1660 $i
		chgrp users $i
	    ;;
	    esac
	  done
	  popd >/dev/null
	fi
	;;
    stop)
	;;
    *)
	echo "Usage: {start|stop}"
	exit 1
	;;
esac
