From 98959fb8a39df9039bf2fa89baf5cb392116e8cd Mon Sep 17 00:00:00 2001 From: Pierre Gode Date: Tue, 2 Apr 2019 14:57:13 +0200 Subject: [PATCH] improved detecting fails and errors. --- ADconnection.sh | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/ADconnection.sh b/ADconnection.sh index f9a4fb4..61f2fbd 100755 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -1278,29 +1278,17 @@ sleep 3 if [ "$ldaptools" = dap-uti ] then echo "ldap tool installed.. trying to find this host" -if ! sudo ldapsearch -x cn="$myhost'*'" -then -echo "Something went wrong. please check your configuration" -exit -fi +sudo ldapsearch -x cn="$myhost'*'" echo "Please type what you are looking for" read -r own -if ! sudo ldapsearch -x | grep -i "$own" -then -echo "Something went wrong. please check your configuration" -exit -fi +sudo ldapsearch -x | grep -i "$own" exit else sudo apt-get install ldap-utils -y echo "${NUMBER}please edit in ldap.conf the lines BASE and URI ${END}" sleep 3 sudo nano /etc/ldap/ldap.conf -if ! sudo ldapsearch -x | grep -i "$myhost" -then -echo "Something went wrong. please check your configuration" -exit -fi +sudo ldapsearch -x | grep -i "$myhost" exit fi }