Update ADconnection.sh

This commit is contained in:
PierreGode 2019-04-01 11:22:45 +02:00 committed by GitHub
parent 3ff61fc2b6
commit 95cb2ce96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -199,7 +199,7 @@ else
echo "Checking sudoers file.. ${RED_TEXT}FAIL${END}"
fi
grouPs=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | awk '{print $1}' | head -1)
if [ "$grouPs" = "$myhost""sudoers" ]
if [ $grouPs = "$myhost""sudoers" ]
then
echo "Checking sudoers user groups.. ${INTRO_TEXT}OK${END}"
else
@ -395,7 +395,7 @@ else
echo "Checking sudoers file.. FAIL"
fi
grouPs=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | awk '{print $1}' | head -1)
if [ "$grouPs" = "$myhost""sudoers" ]
if [ $grouPs = "$myhost""sudoers" ]
then
echo "Checking sudoers user groups.. OK"
else
@ -750,7 +750,7 @@ else
echo checking sudoers file.. "${RED_TEXT}FAIL not configured${END}"
fi
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
echo "Checking sudoers users.. ${INTRO_TEXT}OK${END}"
else
@ -1166,7 +1166,7 @@ if [ -f /etc/sudoers.d/admins ] < /dev/null > /dev/null 2>&1
then
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')
if [ "$grouPs" = "$myhost""sudoers" ]
if [ $grouPs = "$myhost""sudoers" ]
then
echo Checking sudoers users.. "${INTRO_TEXT}OK${END}"
else
@ -1177,7 +1177,7 @@ if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
then
echo Checking sudoers file.. "${INTRO_TEXT}OK${END}"
grouPs1=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g' | head -1)
if [ "$grouPs1" = "$myhost""sudoers" ]
if [ $grouPs1 = "$myhost""sudoers" ]
then
echo Checking sudoers user groups.. "${INTRO_TEXT}OK${END}"
else
@ -1231,7 +1231,7 @@ if [ -f /etc/sudoers.d/admins ] < /dev/null > /dev/null 2>&1
then
echo "Checking sudoers file.. OK"
grouPs=$(grep -i "$myhost" /etc/sudoers.d/admins | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g')
if [ "$grouPs" = "$myhost""sudoers" ]
if [ $grouPs = "$myhost""sudoers" ]
then
echo "Checking sudoers users.. OK"
else
@ -1242,7 +1242,7 @@ if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
then
echo "Checking sudoers file.. OK"
grouPs1=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g' | head -1)
if [ "$grouPs1" = "$myhost""sudoers" ]
if [ $grouPs1 = "$myhost""sudoers" ]
then
echo "Checking sudoers user groups.. OK"
else