mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Fixed checks
This commit is contained in:
parent
8777b36395
commit
51de874723
@ -779,7 +779,7 @@ echo Checking sudoers file.. "${INTRO_TEXT}OK${END}"
|
|||||||
else
|
else
|
||||||
echo checking sudoers file.. "${RED_TEXT}FAIL not configured${END}"
|
echo checking sudoers file.. "${RED_TEXT}FAIL not configured${END}"
|
||||||
fi
|
fi
|
||||||
grouPs=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g')
|
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
|
then
|
||||||
echo "Checking sudoers users.. ${INTRO_TEXT}OK${END}"
|
echo "Checking sudoers users.. ${INTRO_TEXT}OK${END}"
|
||||||
@ -1179,7 +1179,7 @@ fi
|
|||||||
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/sudoers.d/sudoers ] < /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/sudoers | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g' | sed -e 's/sudoers//g' )
|
grouPs=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | awk '{print $1}' | head -1 | sed -e 's/sudoers//g' )
|
||||||
if [ "$grouPs" = "$myhost" ]
|
if [ "$grouPs" = "$myhost" ]
|
||||||
then
|
then
|
||||||
echo Checking sudoers users.. "${INTRO_TEXT}OK${END}"
|
echo Checking sudoers users.. "${INTRO_TEXT}OK${END}"
|
||||||
@ -1249,7 +1249,7 @@ else
|
|||||||
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
if [ -f /etc/sudoers.d/sudoers ] < /dev/null > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo "Checking sudoers file.. OK"
|
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)
|
grouPs1=$(grep -i "$myhost" /etc/sudoers.d/sudoers | cut -d '%' -f2 | awk '{print $1}' | head -1 | head -1)
|
||||||
if [ "$grouPs1" = "$myhost""sudoers" ]
|
if [ "$grouPs1" = "$myhost""sudoers" ]
|
||||||
then
|
then
|
||||||
echo "Checking sudoers user groups.. OK"
|
echo "Checking sudoers user groups.. OK"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user