aboutsummaryrefslogtreecommitdiff
path: root/src/espeakup/espeakup
diff options
context:
space:
mode:
Diffstat (limited to 'src/espeakup/espeakup')
-rwxr-xr-xsrc/espeakup/espeakup43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/espeakup/espeakup b/src/espeakup/espeakup
new file mode 100755
index 0000000..94a7170
--- /dev/null
+++ b/src/espeakup/espeakup
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/conf.d/espeakup
+. /etc/rc.d/functions
+
+PID=`pidof espeakup`
+PIDFILE=/var/run/espeakup.pid
+case "$1" in
+ start)
+ stat_busy "Starting Espeakup"
+ if [ -z "$PID" ]; then
+ if [ -f $PIDFILE ]; then
+ rm $PIDFILE
+ fi
+ /usr/bin/espeakup $ESPEAKUP_ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon espeakup
+ stat_done
+ fi
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Espeakup"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon espeakup
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0