summarylogtreecommitdiffstats
path: root/spacenavd
diff options
context:
space:
mode:
Diffstat (limited to 'spacenavd')
-rw-r--r--spacenavd38
1 files changed, 38 insertions, 0 deletions
diff --git a/spacenavd b/spacenavd
new file mode 100644
index 000000000000..61946197c40b
--- /dev/null
+++ b/spacenavd
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON=/usr/bin/spacenavd
+
+PID=`pidof -o %PPID $DAEMON`
+case "$1" in
+ start)
+ stat_busy "Starting Spacenavigator Daemon"
+ [ -z "$PID" ] && $DAEMON
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon spacenavd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Spacenavigator Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon spacenavd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0