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