From 352ee425447abc76f64e36951f1da6d331c169e9 Mon Sep 17 00:00:00 2001 From: PierreGoude Date: Thu, 2 Feb 2017 23:54:18 +0100 Subject: [PATCH] Update ADconnection.sh --- ADconnection.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ADconnection.sh b/ADconnection.sh index b0e35d5..f965ad6 100644 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -1,4 +1,4 @@ -#!/bin/bash + #!/bin/bash ##################################################################################################################### # # # This script is written by Pierre Goude # @@ -92,6 +92,7 @@ sudo echo "$NetBios"'\'"$myhost""sudoers" >> /etc/ssh/login.group.allowed sudo echo "%domain^admins ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers sudo echo "%$myhost""sudoers ALL=(ALL:ALL) ALL" >> /etc/sudoers.d/sudoers sudo echo "%DOMAIN\ admins@$DOMAIN ALL=(ALL) ALL" >> /etc/sudoers.d/domain_admins +therealm=$(realm discover | grep -i configured: | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//') if [ $therealm = no ] then echo Realm configured?.. "${RED_TEXT}"FAIL"${END}" @@ -101,6 +102,7 @@ fi if [ -f /etc/sudoers.d/sudoers ] then echo Checking sudoers file.. "${INTRO_TEXT}"OK"${END}" +grouPs=$(cat /etc/sudoers.d/sudoers | grep -i $myhost | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\//g') if [ $grouPs = "$myhost""sudoers" ] then echo Checking sudoers users.. "${INTRO_TEXT}"OK"${END}" @@ -111,6 +113,7 @@ else echo checking sudoers file.. "${RED_TEXT}"FAIL"${END}" echo Checking sudoers users.. "${RED_TEXT}"FAIL"${END}" fi +guest=$(cat /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf | grep -i allow-guest | grep -i false | cut -d '=' -f2) if [ $guest = false ] then echo Checking login configuration.. "${INTRO_TEXT}"OK"${END}" @@ -118,10 +121,6 @@ else echo Checking login configuration.. "${RED_TEXT}"FAIL"${END}" fi -guest=$(cat /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf | grep -i allow-guest | grep -i false | cut -d '=' -f2) -grouPs=$(cat /etc/sudoers.d/sudoers | grep -i $myhost | cut -d '%' -f2 | cut -d '=' -f1 | sed -e 's/\//g') -therealm=$(realm discover | grep -i configured: | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//') - exec sudo -u root /bin/sh - <