I used awk to get only users outside an audio_output{}
Still not a beautiful script, but your free to set the user where you want.

USER=`awk 'BEGIN{ao=0} /[ \t]*audio_output[ \t]*{/{ ao = 1 } /[ \t]*}/{
ao = 0 } /^[ \t]*user[ \t]*/{ if (ao == 0) user = $2 } END{ print
substr(user, 2, length(user) - 2) }' $MPDCONF`

For the pidfile thingy I added a function to mpd_start:

check_pid () {
  if [ ! -e `dirname $PIDFILE` ];then
    mkdir `dirname $PIDFILE`
  fi
  chown $USER `dirname $PIDFILE`
}

Cause I don't know why this directory should be created if I just type
/etc/init.d/mpd stop while mpd is not running.

-- 
/var/run/mpd right not set properly when using shoutcast
https://launchpad.net/bugs/73096

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to