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