improved detecting fails and errors.

This commit is contained in:
Pierre Gode 2019-04-02 14:48:32 +02:00
parent 58d3910f42
commit ec423eb73f

View File

@ -1278,10 +1278,18 @@ sleep 3
if [ "$ldaptools" = dap-uti ] if [ "$ldaptools" = dap-uti ]
then then
echo "ldap tool installed.. trying to find this host" echo "ldap tool installed.. trying to find this host"
sudo ldapsearch cn="$myhost'*'" if ! sudo ldapsearch cn="$myhost'*'"
then
echo "Something went wrong. please check your configuration"
exit
fi
echo "Please type what you are looking for" echo "Please type what you are looking for"
read -r own read -r own
sudo ldapsearch | grep -i "$own" if ! sudo ldapsearch | grep -i "$own"
then
echo "Something went wrong. please check your configuration"
exit
fi
exit exit
else else
sudo apt-get install ldap-utils -y sudo apt-get install ldap-utils -y