6 SPEECHD_CMD
="/usr/bin/speech-dispatcher -d -c unix_socket -S /var/run/speech-dispatcher/speechd.sock -P /var/run/speech-dispatcher/speech-dispatcher.pid"
7 PID
=$
(pidof
-o %PPID
/usr
/bin
/speech-dispatcher
)
11 stat_busy
"Starting speech dispatcher Daemon"
13 if [ ! $
(egrep '^speechd:' /etc
/group
) ]; then
14 stat_busy
"Adding speechd group"
18 if [ ! $
(egrep '^speechd:' /etc
/passwd
) ]; then
19 stat_busy
"Creating speechd user and adding to audio group"
20 useradd
-r -g speechd
-G audio
-d /var
/run
/speech-dispatcher
-s /bin
/false speechd
23 if [ ! -d /var
/log
/speech-dispatcher
]; then
24 mkdir
/var
/log
/speech-dispatcher
25 chown speechd
:speechd
/var
/log
/speech-dispatcher
27 if [ ! -d /var
/run
/speech-dispatcher
]; then
28 mkdir
/var
/run
/speech-dispatcher
29 chown speechd
:speechd
/var
/run
/speech-dispatcher
33 [ -z "$PID" ] && su speechd
-s /bin
/sh
-c "$SPEECHD_CMD"
38 chmod 755 /etc
/profile.d
/speechd.sh
43 stat_busy
"Stopping speech dispatcher Daemon"
44 [ ! -z "$PID" ] && kill $PID &> /dev
/null
49 chmod 644 /etc
/profile.d
/speechd.sh
59 echo "usage: $0 {start|stop|restart}"