S99shairport-sync 557 B

123456789101112131415161718192021222324252627
  1. #! /bin/sh
  2. # Additional options that are passed to Shairport Sync
  3. OPTIONS="-d"
  4. case "$1" in
  5. start)
  6. printf "Starting shairport-sync: "
  7. start-stop-daemon -S -q --exec /usr/bin/shairport-sync -- $OPTIONS
  8. [ $? = 0 ] && echo "OK" || echo "FAIL"
  9. ;;
  10. stop)
  11. printf "Stopping shairport-sync: "
  12. start-stop-daemon -K -q --exec /usr/bin/shairport-sync \
  13. -p /var/run/shairport-sync/shairport-sync.pid
  14. [ $? = 0 ] && echo "OK" || echo "FAIL"
  15. ;;
  16. restart)
  17. $0 stop
  18. sleep 1
  19. $0 start
  20. ;;
  21. *)
  22. echo "Usage: $0 {start|stop|restart}"
  23. exit 1
  24. ;;
  25. esac