improved detecting fails and errors.

This commit is contained in:
Pierre Gode 2019-04-02 13:47:45 +02:00
parent 35cde14551
commit fa78bf1526

View File

@ -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,18 +1627,17 @@ 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
fi else
sudo realm discover
exit
fi
else else
echo "" echo ""
exit 1 exit 1
@ -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 ""