You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
556 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2007-2014 OpenWrt.org
  3. START=93
  4. USE_PROCD=1
  5. PROG=/usr/bin/mpd
  6. CONFIGFILE=/etc/mpd.conf
  7. NICEPRIO=-10
  8. #TODO: Add uci config - nice, config
  9. start_service() {
  10. #create mpd directories from config
  11. local pld=`grep ^playlist_directory "$CONFIGFILE" | cut -d "\"" -f 2 | sed "s/~/\/root/g"`
  12. if [ ! -d $pld ]; then
  13. mkdir -m 0755 -p $pld
  14. fi
  15. procd_open_instance
  16. procd_set_param command "$PROG" --no-daemon "$CONFIGFILE"
  17. # Give MPD some real-time priority
  18. procd_set_param nice "$NICEPRIO"
  19. procd_close_instance
  20. }