2007-11-08 00:37:14 +00:00
|
|
|
#!/bin/sh
|
2008-04-02 00:44:58 +00:00
|
|
|
#
|
|
|
|
# spacenavd free driver for 3Dconnexion 6dof devices
|
|
|
|
#
|
|
|
|
# chkconfig: 2345 99 99
|
|
|
|
# description: A free user space driver for 3Dconnexion input devices,\
|
|
|
|
# compatible with the proprietary 3dxsrv daemon.
|
2007-11-08 00:37:14 +00:00
|
|
|
|
|
|
|
DAEMON=/usr/local/bin/spacenavd
|
|
|
|
|
|
|
|
[ -x "$DAEMON" ] || exit 0
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo 'Starting spacenavd daemon'
|
2008-04-07 08:31:27 +00:00
|
|
|
$DAEMON -v
|
2007-11-08 00:37:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
|
|
|
echo 'Stopping spacenavd daemon'
|
2008-04-09 04:27:12 +00:00
|
|
|
# detect daemon's process id
|
2009-02-02 02:21:40 +00:00
|
|
|
pid=`cat /var/run/spnavd.pid 2>/dev/null`
|
2008-04-09 04:27:12 +00:00
|
|
|
if [ $? != 0 ]; then
|
|
|
|
pid=`ps -e | grep spacenavd | awk '{ print $1 }'`
|
|
|
|
if [ -z "$pid" ]; then
|
|
|
|
echo 'spacenavd daemon is not running, nothing to do.'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
kill $pid
|
2007-11-08 00:37:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
reload|restart|force-reload)
|
2009-07-24 02:52:07 +00:00
|
|
|
$0 stop && sleep 1 && $0 start
|
2007-11-08 00:37:14 +00:00
|
|
|
;;
|
|
|
|
esac
|