colordiff: Update from 1.0.16 to 1.0.18
[termux-packages] / packages / mpd / mpd-script.sh
CommitLineData
49196266 1mpd_test=$(pgrep -f /data/data/com.termux/files/usr/libexec/mpd)
2CmdArgs=$(echo "$@")
3#echo $mpd_test
4mkdir -p ~/music
5mkdir -p ~/.mpd
6mkdir -p ~/.mpd/playlists
7touch ~/.mpd/state
8touch ~/.mpd/log
9touch ~/.mpd/pid
10if [ "x$CmdArgs" = x ] ; then
11 if [ -z "$MULTIPLE_MPDS" ] ; then
12 if [ -n "$mpd_test" ] ; then
13 echo -n "restart music player daemon (y/n)? "
14 read answer
15 if echo "$answer" | grep -iq "^y" ;then
16 echo "restarting music player daemon"
17 pgrep -f /data/data/com.termux/files/usr/libexec/mpd | while read line; do kill "$line"; done
18 else
19 echo "doing nothing"
20 exit
21 fi
22 else
23 echo "starting mpd the music player daemon"
24 fi
25 sleep 0.5;
26 chmod +rw ~/.mpd/* 2>&1 > /dev/null
27 rm -rf ~/.mpd/pid 2>&1 > /dev/null
28 fi
29fi