improved detecting fails and errors.

This commit is contained in:
Pierre Gode 2019-04-02 13:21:49 +02:00
parent 60063f372b
commit 50c80a2fe6

View File

@ -1151,7 +1151,7 @@ read -r DOMAIN
else else
echo "" echo ""
fi fi
therealm=$( realm discover | grep -i realm-name | awk '{print $2}') therealm=$( realm discover | grep -i configured | awk '{print $2}')
if [ "$therealm" = "no" ] if [ "$therealm" = "no" ]
then then
echo Realm configured?.. "${RED_TEXT}FAIL${END}" echo Realm configured?.. "${RED_TEXT}FAIL${END}"
@ -1161,7 +1161,7 @@ fi
if [ -f /etc/sudoers.d/admins ] < /dev/null > /dev/null 2>&1 if [ -f /etc/sudoers.d/admins ] < /dev/null > /dev/null 2>&1
then then
echo Checking sudoers file.. "${INTRO_TEXT}OK${END}" echo Checking sudoers file.. "${INTRO_TEXT}OK${END}"
grouPs=$(grep -i "$myhost" /etc/sudoers.d/admins | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g') grouPs=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g')
if [ $grouPs = "$myhost""sudoers" ] if [ $grouPs = "$myhost""sudoers" ]
then then
echo Checking sudoers users.. "${INTRO_TEXT}OK${END}" echo Checking sudoers users.. "${INTRO_TEXT}OK${END}"