From 44c81e2b07dbfb2350297a8170ee0ea131c37e42 Mon Sep 17 00:00:00 2001 From: Pierre Gode Date: Tue, 2 Apr 2019 13:27:53 +0200 Subject: [PATCH] improved detecting fails and errors. --- ADconnection.sh | 2 ++ tempCodeRunnerFile.sh | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 tempCodeRunnerFile.sh diff --git a/ADconnection.sh b/ADconnection.sh index 7334fe9..34361fd 100755 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -1144,6 +1144,7 @@ exit failcheck(){ clear export HOSTNAME +myhost=$( hostname | cut -d '.' -f1 ) if ! hostname | cut -d '.' -f1 then echo "Sorry I am having issues finding your domain.. please type it" @@ -1208,6 +1209,7 @@ exit failcheck_yum(){ clear export HOSTNAME +myhost=$( hostname | cut -d '.' -f1 ) if ! hostname | cut -d '.' -f1 then echo "Sorry I am having issues finding your domain.. please type it" diff --git a/tempCodeRunnerFile.sh b/tempCodeRunnerFile.sh new file mode 100644 index 0000000..5b2eae6 --- /dev/null +++ b/tempCodeRunnerFile.sh @@ -0,0 +1,8 @@ +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/\//g') + if [ $grouPs = "$myhost""sudoers" ] + then + echo Checking sudoers users.. "${INTRO_TEXT}OK${END}" + else + echo Checking sudoers users.. "${RED_TEXT}FAIL${END}" + fi \ No newline at end of file