#!/sbin/runscript

depend() {
	need net
	use jabber-server
}

start() {
	ebegin "Starting Yahoo Jabber Transport"
	start-stop-daemon --start --pidfile /var/run/yahoo-transport.pid \
	--make-pidfile --background --startas /usr/sbin/jabberd \
	-- -B -c /etc/jabber/yahootrans.xml -H /var/spool/jabber
	eend $?
}

stop() {
	ebegin "Stoping Yahoo Jabber Transport"
	#Yahoo transport does not creat a pid file
	#And after starting it forks so the pid generated by start-stop-daemon is
	#no good
	#So we use this very ugly hack
	PIDFILE=`ps aux |grep jabberd |grep yahoo|cut -c 9-15`
	kill ${PIDFILE}
	eend $?
}