Update ADconnection.sh

This commit is contained in:
PierreGode 2018-08-09 09:19:18 +02:00 committed by GitHub
parent 1cc623b1d8
commit 553acda429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,10 +756,46 @@ exit
} }
############################### Fedora ######################################### ############################### Fedora #########################################
Fedora_fn(){ Fedora_fn(){
echo "this is fedora" export HOSTNAME
myhost=$( hostname )
yum -y install realmd sssd oddjob oddjob-mkhomedir adcli samba-common-tools samba-common
DOMAIN=$(realm discover | grep -i realm-name | awk '{print $2}')
ping -c 1 $DOMAIN
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 "${INTRO_TEXT}"Please log in with domain admin to $DOMAIN to connect"${END}";;
[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
echo "${NUMBER}I Please enter AD admin user ${END}"
read -r ADMIN
fi
clear
sudo echo "Please enter AD admin user:"
read -r ADMIN
sudo echo "${INTRO_TEXT}"Realm= $DOMAIN"${INTRO_TEXT}"
sudo echo "${NORMAL}${NORMAL}"
sudo realm join -v -U $ADMIN $DOMAIN --install=/
if [ $? -ne 0 ]; then
echo "${RED_TEXT}"AD join failed.please check that computer object is already created and test again "${END}"
exit 1
fi
fi_auth
exit exit
} }
############################### Update to Realmd from likewise ################## ############################### Update to Realmd from likewise ##################
Realmdupdate(){ Realmdupdate(){
clear clear
@ -1074,7 +1110,7 @@ while [ opt != '' ]
else else
case $opt in case $opt in
1) clear; 1) clear;
echo "Installing on Ubuntu Client/Server"; echo "Installing on Linux Client/Server";
linuxclient; linuxclient;
;; ;;
2) clear; 2) clear;