chiark / gitweb /
mpd only working with openal and no mixer still good (#1007)
[termux-packages] / packages / mpd / mpd-script.sh
1 mpd_test=$(pgrep -f /data/data/com.termux/files/usr/libexec/mpd)
2 CmdArgs=$(echo "$@")
3 #echo $mpd_test
4 mkdir -p ~/music 
5 mkdir -p ~/.mpd
6 mkdir -p ~/.mpd/playlists
7 touch ~/.mpd/state
8 touch ~/.mpd/log
9 touch ~/.mpd/pid
10 if [ "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
29 fi