From dc8925a6914179ae146fd5f0a147f0c9507c2748 Mon Sep 17 00:00:00 2001 From: PierreGoude Date: Tue, 31 Jan 2017 08:43:02 +0100 Subject: [PATCH] Update ADconnection.sh --- ADconnection.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ADconnection.sh b/ADconnection.sh index b405d4e..aa94872 100644 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -29,8 +29,16 @@ myhost=$( hostname ) sudo apt-get install realmd adcli sssd -y sudo apt-get install ntp -y clear -echo "Please enter the domain you wish to join: " -read DOMAIN + +DOMAIN=$(realm discover | grep -i domain.name | cut -d ':' -f2) +read -p "I seached for an available domain and found $DOMAIN : do you wish to use it (y/n)?" yn + case $yn in + [Yy]* ) echo 'yes!';; + + [Nn]* ) echo "Please enter the domain you wish to join: " +read DOMAIN;; + * ) echo 'Please answer yes or no.';; + esac NetBios=$(echo $DOMAIN | cut -d '.' -f1) echo "Please enter a domain admin login to use: " read ADMIN