#!/bin/sh
########################################################################
# Begin $rc_base/init.d/
#
# Description :
#
# Authors     :
#
# Version     : 00.00
#
# Notes       :
#
########################################################################

. /etc/sysconfig/rc
. ${rc_functions}

case "${1}" in
	start)
		boot_mesg "Starting transmission daemon..."
		chown -R nobody /etc/transmission
		chown -R nobody /var/transmission
		sudo -u nobody transmission-daemon -g /etc/transmission
		evaluate_retval
		;;

	stop)
		boot_mesg "Stopping transmission daemon..."
		killall transmission-daemon
		evaluate_retval
		;;

	restart)
		${0} stop
		sleep 1
		${0} start
		;;

	status)
		statusproc transmission-daemon
		;;

	*)
		echo "Usage: ${0} {start|stop|restart|status}"
		exit 1
		;;
esac

# End $rc_base/init.d/
