#!/bin/bash

. /usr/lib/pm-utils/functions

case "$1" in
	hibernate|suspend)
		sync
		killall -HUP -q rhythmbox
                hal-disable-polling --device /dev/cdrom
		;;
	thaw|resume)
		killall -HUP cheese
		killall -HUP rhythmbox
                hal-disable-polling --enable-polling --device /dev/cdrom
		;;
	*)
		;;
esac

exit $?
