# ezstream startup script
# see init(5) for details

description "ezstream for ardj"
author "Justin Forest <hex@umonkey.net>"

script
	export PATH=/home/radio/bin:/home/radio/ardj/bin:$PATH
	export PYTHONPATH=/home/radio/ardj/src

	if [ -f /var/run/ezstream.pid ]; then
		sleep 5
		rm -f /var/run/ezstream.pid
	fi

	exec start-stop-daemon --start --quiet --chuid radio \
		--make-pidfile --pidfile /var/run/ezstream.pid \
		--exec /usr/bin/ezstream -- -c /home/radio/ezstream.xml
end script

start on started icecast
stop on runlevel [06]

respawn
