custom mpd client launcher

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/bin/bash
if [[ ! -e /var/run/mpd/mpd.pid ]]; then
sudo /etc/rc.d/mpd start
fi && \
if [[ ! -e /var/run/scrobby/scrobby.pid ]]; then
sudo /etc/rc.d/scrobby start
fi && \
/usr/bin/ncmpcpp
echo -n 'Do you want to stop mpd? [n] '
read s
if [[ "$s" = 'y' ]]; then
sudo /etc/rc.d/scrobby stop
sudo rm -f /var/run/scrobby/scrobby.pid
sudo /etc/rc.d/mpd stop
sudo rm -f /var/run/mpd/mpd.pid
fi