From 7589aa4680e96d80046fa1d70da837c80815cd41 Mon Sep 17 00:00:00 2001 From: PierreGode Date: Mon, 13 Aug 2018 10:34:18 +0200 Subject: [PATCH] Update ADconnection.sh --- ADconnection.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ADconnection.sh b/ADconnection.sh index 1f87d40..2bd70a2 100644 --- a/ADconnection.sh +++ b/ADconnection.sh @@ -1013,6 +1013,30 @@ sudo aptitude install ntp adcli sssd sudo mkdir -p /var/lib/samba/private sudo aptitude install libsss-sudo sudo systemctl enable sssd +echo "hostname is $myhost" +echo "Looking for Realms.. please wait" +DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}') +ping -c 2 $DOMAIN >/dev/null +if [ $? = 0 ] +then +clear +echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}" +read -p "Do you wish to use it (y/n)?" yn + case $yn in + [Yy]* ) echo "";; + + [Nn]* ) echo "Please enter the domain you wish to join:" + read -r DOMAIN;; + * ) echo 'Please answer yes or no.';; + esac +else +clear +echo "${NUMBER}I searched for an available domain and found nothing, please type your domain manually below... ${END}" +echo "Please enter the domain you wish to join:" +read -r DOMAIN +fi +NetBios=$(echo $DOMAIN | cut -d '.' -f1) +clear clear DOMAIN=$( realm discover | grep -i realm-name | awk '{print $2}' ) echo ""