diff --git a/bin/mpd-monitor b/bin/mpd-monitor index 7324c70..009c984 100755 --- a/bin/mpd-monitor +++ b/bin/mpd-monitor @@ -1,15 +1,8 @@ #!/bin/sh -# exit if another instance is already running -#if [ !$(pidof mpd-monitor > /dev/null) ]; then -# echo "mpd-monitor already running" -# exit -#fi - -# this might actually work... -RUNNING=$(pidof mpc > /dev/null) -if [ !$RUNNING ]; then - echo "mpd-monitor already running" +PID=$(pgrep -x mpc) +if [ -n "$PID" ]; then + echo "another instance of mpd-monitor already running" exit fi