From 380c4a9ea557eb1d70dd347c5972c18d0488d4e9 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Sat, 22 Oct 2016 13:41:58 +0200 Subject: [PATCH] [mpdstats_] use 'which' for finding 'nc' --- plugins/mpd/mpdstats_ | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/mpd/mpdstats_ b/plugins/mpd/mpdstats_ index b54edfdc..65f9194f 100755 --- a/plugins/mpd/mpdstats_ +++ b/plugins/mpd/mpdstats_ @@ -69,7 +69,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. MPDHOST=${mpd_host:-localhost} MPDPORT=${mpd_port:-6600} -NCBIN=${netcat:-/bin/nc} +NCBIN=${netcat:-$(which nc)} + # # FUNCTIONS @@ -85,8 +86,8 @@ do_autoconf () { ;; esac - if [ ! -x $NCBIN ] ; then - echo "no ($NCBIN: not found or not executable)" + if [ -z "$NCBIN" ] ; then + echo "no (missing netcat program ('nc'))" exit 1 fi