From cb1a4c2294ad4900a003d0b86ae17d5a9dc9f97f Mon Sep 17 00:00:00 2001 From: PierreGoude Date: Tue, 7 Feb 2017 15:42:45 +0100 Subject: [PATCH] Update ADconnection.sh --- ADconnection.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/ADconnection.sh b/ADconnection.sh index fa543da..edda132 100644 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -411,16 +411,28 @@ fi if [ -f /etc/sudoers.d/admins ] then echo Checking sudoers file.. "${INTRO_TEXT}"OK"${END}" -else -echo checking sudoers file.. "${RED_TEXT}"FAIL"${END}" -fi grouPs=$(cat /etc/sudoers.d/admins | grep -i $myhost | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\//g') -if [ $grouPs = "$myhost""sudoers" ] -then -echo Checking sudoers users.. "${INTRO_TEXT}"OK"${END}" + if [ $grouPs = "$myhost""sudoers" ] + then + echo Checking sudoers users.. "${INTRO_TEXT}"OK"${END}" + else + echo Checking sudoers users.. "${RED_TEXT}"FAIL"${END}" + fi +else +if [ -f /etc/sudoers.d/sudoers ] +then +echo Checking sudoers file.. "${INTRO_TEXT}"OK"${END}" +grouPs1=$(cat /etc/sudoers.d/sudoers | grep -i $myhost | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\//g') + if [ $grouPs1 = "$myhost""sudoers" ] + then + echo Checking sudoers users.. "${INTRO_TEXT}"OK"${END}" + else + echo Checking sudoers users.. "${RED_TEXT}"FAIL"${END}" + fi else echo Checking sudoers users.. "${RED_TEXT}"FAIL"${END}" fi +fi homedir=$(cat /etc/pam.d/common-session | grep homedir | grep 0022 | cut -d '=' -f3) if [ $homedir = 0022 ] then