All pastes #287773 Raw Edit

Unnamed

public text v1 · immutable
#287773 ·published 2006-12-21 19:32 UTC
rendered paste body
#!/bin/bash
mkdir -p ~/.mpd
touch ~/.mpd/state
sed -i 's/state: play/state: stop/g' ~/.mpd/state

handle() {
    killall mpd
}

for s in HUP INT TERM; do
    trap handle $s;
done
t=`trap`

handle; sleep 1;
mpd --no-daemon --stdout
eval "$t"