1#!/bin/sh 2# 3# start/stop neard daemon. 4 5### BEGIN INIT INFO 6# Provides: neard 7# Required-Start: $network 8# Required-Stop: $network 9# Default-Start: S 2 3 4 5 10# Default-Stop: 0 1 6 11# Short-Description: NFC daemon 12# Description: neard is a daemon used to enable NFC features 13### END INIT INFO 14 15DAEMON=@installpath@/neard 16PIDFILE=/var/run/neard.pid 17DESC="Linux NFC daemon" 18 19if [ -f /etc/default/neard ] ; then 20 . /etc/default/neard 21fi 22 23set -e 24 25do_start() { 26 $DAEMON 27} 28 29do_stop() { 30 start-stop-daemon --stop --name neard --quiet 31} 32 33case "$1" in 34 start) 35 echo "Starting $DESC" 36 do_start 37 ;; 38 stop) 39 echo "Stopping $DESC" 40 do_stop 41 ;; 42 restart|force-reload) 43 echo "Restarting $DESC" 44 do_stop 45 sleep 1 46 do_start 47 ;; 48 *) 49 echo "Usage: $0 {start|stop|restart|force-reload}" >&2 50 exit 1 51 ;; 52esac 53 54exit 0 55