neard.in 829 B

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