From ac2043ecb6d35443cece4f15f85c8abfb86d2472 Mon Sep 17 00:00:00 2001 From: Salt Date: Tue, 13 Aug 2019 03:39:19 -0500 Subject: [PATCH] ptgdp: Add sanity check for MPD --- ptgdp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ptgdp b/ptgdp index d97d29d..acc4224 100755 --- a/ptgdp +++ b/ptgdp @@ -144,6 +144,12 @@ playlist() { log "Music can be found at \"$_musicdir\"" fi fi + if [ -z "$_optdownloadonly" ] && ! mpc status > /dev/null 2>&1; then + notify "Could not communicate with MPD" \ + "MPD connection was refused. Ensure your configuration is correct and the daemon is currently running." \ + normal dialog-error 3000 + error "Failed to communicate with MPD" 52 + fi local -i dlexist=0 local -i dlsuccess=0 local -i dlfailure=0