From 9b92e58e011fc81215abb7988d1b7a6425474ed2 Mon Sep 17 00:00:00 2001
From: Juergen Hoetzel <juergen@archlinux.org>
Date: Wed, 11 Sep 2013 18:07:27 +0200
Subject: [PATCH] Don't depend on external 'which' command

Use bash-builtin 'type' instead. For a complete discussion, why
'which' should be avoided, see:
http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
---
 x2goserver/bin/x2goruncommand | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand
index 64469ed..7dcc7fb 100755
--- a/x2goserver/bin/x2goruncommand
+++ b/x2goserver/bin/x2goruncommand
@@ -194,14 +194,14 @@ if [ "$cmd" == "TERMINAL" ]; then
 	fi
 fi
 
-EXEC=`which $cmd`
+EXEC=`type -P $cmd`
 EXEC_WRAPPER=""
 
 BNAME=`basename "$EXEC"`
 if [ "$BNAME" == "rdesktop" ]
 then
 	IMEXIT="true"
-	if which padsp >/dev/null; then
+	if type padsp >/dev/null; then
 		EXEC_WRAPPER="padsp"
 		args=" -r sound:local"
 	fi
-- 
1.8.4

