mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
improved detecting fails and errors.
This commit is contained in:
parent
35cde14551
commit
fa78bf1526
@ -612,10 +612,6 @@ read -r ADMIN
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi_auth
|
fi_auth
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1174,7 +1170,7 @@ 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}"
|
||||||
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 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g' | head -1)
|
||||||
if [ "$grouPs"1 = "$myhost""sudoers" ]
|
if [ "$grouPs1" = "$myhost""sudoers" ]
|
||||||
then
|
then
|
||||||
echo Checking sudoers user groups.. "${INTRO_TEXT}OK${END}"
|
echo Checking sudoers user groups.. "${INTRO_TEXT}OK${END}"
|
||||||
else
|
else
|
||||||
@ -1185,7 +1181,7 @@ echo Checking sudoers file.. "${RED_TEXT}FAIL not configured${END}"
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
homedir=$(grep homedir /etc/pam.d/common-session | grep 0022 | cut -d '=' -f3)
|
homedir=$(grep homedir /etc/pam.d/common-session | grep 0022 | cut -d '=' -f3)
|
||||||
if [ "$homedir" = "0022" ] < /dev/null > /dev/null 2>&1
|
if [ "$homedir" -eq "0022" ] < /dev/null > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo Checking PAM configuration.. "${INTRO_TEXT}OK${END}"
|
echo Checking PAM configuration.. "${INTRO_TEXT}OK${END}"
|
||||||
else
|
else
|
||||||
@ -1239,7 +1235,7 @@ 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 | cut -d '=' -f1 | sed -e 's/\<ALL\>//g' | head -1)
|
||||||
if [ "$grouPs"1 = "$myhost""sudoers" ]
|
if [ "$grouPs1" = "$myhost""sudoers" ]
|
||||||
then
|
then
|
||||||
echo "Checking sudoers user groups.. OK"
|
echo "Checking sudoers user groups.. OK"
|
||||||
else
|
else
|
||||||
@ -1631,17 +1627,16 @@ while test $# -gt 0; do
|
|||||||
;;
|
;;
|
||||||
-s)
|
-s)
|
||||||
if test $# -gt 0; then
|
if test $# -gt 0; then
|
||||||
realm < /dev/null > /dev/null 2>&1
|
if ! realm < /dev/null > /dev/null 2>&1
|
||||||
if [ "$?" = "0" ]
|
|
||||||
then
|
then
|
||||||
sudo realm discover
|
|
||||||
exit
|
|
||||||
else
|
|
||||||
clear
|
clear
|
||||||
echo ""
|
echo ""
|
||||||
echo "realmd is not installed"
|
echo "realmd is not installed"
|
||||||
echo ""
|
echo ""
|
||||||
exit
|
exit
|
||||||
|
else
|
||||||
|
sudo realm discover
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
@ -1772,10 +1767,6 @@ read -r ADMIN
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe ${END}"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
fi_auth
|
fi_auth
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user