mirror of
https://github.com/PierreGode/Linux-Active-Directory-join-script.git
synced 2025-12-21 08:50:12 +01:00
Update ADconnection.sh
This commit is contained in:
parent
47abed20ae
commit
ecb2fd87ef
@ -525,7 +525,8 @@ else
|
|||||||
if [ "$elementary" = "elementary" ]
|
if [ "$elementary" = "elementary" ]
|
||||||
then
|
then
|
||||||
echo "${INTRO_TEXT}Detected Elementary${END}"
|
echo "${INTRO_TEXT}Detected Elementary${END}"
|
||||||
UbuntU
|
sleep 1
|
||||||
|
elemntary_fn
|
||||||
else
|
else
|
||||||
if [ "$MintOS" = Mint ]
|
if [ "$MintOS" = Mint ]
|
||||||
then
|
then
|
||||||
@ -1119,6 +1120,55 @@ fi_auth_yum
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
############################# Elemntary #####################################
|
||||||
|
elemntary_fn(){
|
||||||
|
export HOSTNAME
|
||||||
|
myhost=$( hostname | cut -d '.' -f1 )
|
||||||
|
sudo apt-get -qq install -y realmd sssd sssd-tools samba-common krb5-user
|
||||||
|
sudo apt-get -qq install -f -y
|
||||||
|
echo "hostname is $myhost"
|
||||||
|
echo "Looking for Realms.. please wait"
|
||||||
|
DOMAIN=$(realm discover | grep -i realm.name | awk '{print $2}')
|
||||||
|
if ! ping -c 2 "$DOMAIN" >/dev/null
|
||||||
|
then
|
||||||
|
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
|
||||||
|
else
|
||||||
|
clear
|
||||||
|
echo "${NUMBER}I searched for an available domain and found ${MENU}>>> $DOMAIN <<<${END}${END}"
|
||||||
|
read -r -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
|
||||||
|
fi
|
||||||
|
clear
|
||||||
|
echo "${INTRO_TEXT}Please log in with domain admin to $DOMAIN to connect${END}"
|
||||||
|
echo "${INTRO_TEXT}Please type Admin user:${END}"
|
||||||
|
read -r ADMIN
|
||||||
|
NetBios=$(echo "$DOMAIN" | cut -d '.' -f1)
|
||||||
|
clear
|
||||||
|
if ! sudo realm join --verbose --user="$ADMIN" "$DOMAIN"
|
||||||
|
then
|
||||||
|
echo "${RED_TEXT}AD join failed.please check your errors with journalctl -xe${END}"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
allowguest=$( sudo grep manual /usr/share/lightdm/lightdm.conf.d/50-disable-guest.conf | grep true | cut -d '=' -f2 | head -1 )
|
||||||
|
if [ "$allowguest" = "true" ]
|
||||||
|
then
|
||||||
|
echo "Lightdm is already configured.. skipping.."
|
||||||
|
else
|
||||||
|
sudo echo "greeter-show-manual-login=true" | sudo tee -a /usr/share/lightdm/lightdm.conf.d/50-disable-guest.conf
|
||||||
|
fi
|
||||||
|
fi_auth
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
############################# Linux Mint #####################################
|
############################# Linux Mint #####################################
|
||||||
LinuxMint(){
|
LinuxMint(){
|
||||||
export HOSTNAME
|
export HOSTNAME
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user