konfd.init 426 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. # Check for missing binaries
  3. BIN=/usr/bin/konfd
  4. test -x $BIN || exit 5
  5. PID=/var/run/konfd.pid
  6. case "$1" in
  7. start)
  8. echo "Starting konfd daemon..."
  9. test -r $PID && { echo "The service is already running."; exit 1; }
  10. $BIN -p $PID
  11. ;;
  12. stop)
  13. echo "Stopping konfd daemon..."
  14. test ! -r $PID && { echo "The service is not running."; exit 1; }
  15. kill $(cat $PID)
  16. ;;
  17. *)
  18. echo "Usage: $0 {start|stop}"
  19. exit 1
  20. ;;
  21. esac