diff options
author | piernov <piernov@piernov.org> | 2012-01-22 11:38:02 +0100 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2012-01-22 11:38:02 +0100 |
commit | 50e5ce5b17e69be13228e2393c5804b0a79acfab (patch) | |
tree | 9845fa9af128d7fdd791755bb2be320f3ba2be4e /gpsd/gpsd.rc | |
parent | 9626427c1a1d9c292fc519810c13b9a8073e777f (diff) | |
parent | 8548e8d6882b55dfb509b18dedfb7db17630037d (diff) | |
download | nutyx-extra-50e5ce5b17e69be13228e2393c5804b0a79acfab.tar.gz nutyx-extra-50e5ce5b17e69be13228e2393c5804b0a79acfab.tar.bz2 nutyx-extra-50e5ce5b17e69be13228e2393c5804b0a79acfab.tar.xz nutyx-extra-50e5ce5b17e69be13228e2393c5804b0a79acfab.zip |
Merged with http://kiao.no-ip.info/NuTyX/git/nutyx-pakxe → Repository splitted → nutyx-extra
Diffstat (limited to 'gpsd/gpsd.rc')
-rwxr-xr-x | gpsd/gpsd.rc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gpsd/gpsd.rc b/gpsd/gpsd.rc new file mode 100755 index 000000000..102c9663e --- /dev/null +++ b/gpsd/gpsd.rc @@ -0,0 +1,39 @@ +#!/bin/sh +######################################################################## +# Begin $rc_base/init.d/gpsd +# Description : A daemon for managing GPS. +######################################################################## + +. /etc/sysconfig/rc +. ${rc_functions} +[ -f /etc/sysconfig/gpsd ] && . /etc/sysconfig/gpsd + +NAME=gpsd +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME/$NAME.pid +PID=$(cat $PIDFILE 2>/dev/null) + +case "$1" in + start) + boot_mesg "Starting $NAME" + [ ! -d /var/run/$NAME ] && install -d /var/run/$NAME + [ -z "$PID" ] && loadproc "$DAEMON" -P $PIDFILE -F /var/run/$NAME/$NAME.sock ${GPSD_OPTIONS} ${DEVICES} + ;; + stop) + boot_mesg "Stopping $NAME" + [ ! -z "$PID" ] && killproc -p $PIDFILE "$DAEMON" + rm -f $PIDFILE + ;; + restart) + $0 stop + sleep 2 + $0 start + ;; + status) + statusproc -p $PIDFILE "$DAEMON" + ;; + *) + echo "usage: $0 {start|stop|restart|status}" +esac + +# End $rc_base/init.d/gpsd |