core/speech-dispatcher/speechd.sh

37 lines
665 B
Bash
Raw Normal View History

2010-05-24 23:40:27 +08:00
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
PID=$(pidof -o %PPID /usr/bin/speech-dispatcher)
case "$1" in
start)
stat_busy "Starting speech dispatcher Daemon"
2011-09-01 05:55:31 +08:00
[ -z "$PID" ] && /usr/bin/speech-dispatcher -d &> /dev/null
2010-05-24 23:40:27 +08:00
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon speechd
stat_done
fi
;;
stop)
stat_busy "Stopping speech dispatcher Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon speechd
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
2011-09-01 05:55:31 +08:00
exit 0