From b6f7819662f7773c5f8ff123411a2c9944a792cb Mon Sep 17 00:00:00 2001 From: PierreGoude Date: Thu, 2 Feb 2017 13:19:46 +0100 Subject: [PATCH] Update ADconnection.sh --- ADconnection.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ADconnection.sh b/ADconnection.sh index 177c199..1a1fa25 100644 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -25,12 +25,14 @@ sudo ####################### Setup for Ubuntu16 and Ubuntu 14 clients ####################################### ubuntuclient(){ export HOSTNAME +myhost=$( hostname ) sudo apt-get install realmd adcli sssd -y sudo apt-get install ntp -y clear DOMAIN=$(realm discover | grep -i realm.name | cut -d ':' -f2 | sed -e 's/^[[:space:]]*//') echo "${NUMBER}I searched for an available domain and found >>> $DOMAIN <<< ${END}" - +discovery=$(realm discover $DOMAIN | grep domain-name) +NetBios=$(echo $DOMAIN | cut -d '.' -f1) read -p "Do you wish to use it (y/n)?" yn case $yn in [Yy]* ) echo "${INTRO_TEXT}"Please log in with domain admin to $DOMAIN to connect"${END}";; @@ -115,15 +117,11 @@ echo Checking login configuration.. "${INTRO_TEXT}"OK"${END}" else echo Checking login configuration.. "${RED_TEXT}"FAIL"${END}" fi -#variables -myhost=$( hostname ) -NetBios=$(echo $DOMAIN | cut -d '.' -f1) -discovery=$(realm discover $DOMAIN | grep domain-name) 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 - <