improved detecting fails and errors.

This commit is contained in:
Pierre Gode 2019-04-02 14:46:31 +02:00
parent fa78bf1526
commit cbf6057151
2 changed files with 6 additions and 10 deletions

View File

@ -1288,7 +1288,11 @@ 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
sudo ldapsearch | grep -i "$myhost"
if ! sudo ldapsearch | grep -i "$myhost"
then
echo "Something went wrong. please check your configuration"
exit
fi
exit
fi
}

View File

@ -1,8 +0,0 @@
echo Checking sudoers file.. "${INTRO_TEXT}OK${END}"
grouPs=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g')
if [ $grouPs = "$myhost""sudoers" ]
then
echo Checking sudoers users.. "${INTRO_TEXT}OK${END}"
else
echo Checking sudoers users.. "${RED_TEXT}FAIL${END}"
fi