Update ADconnection.sh

This commit is contained in:
PierreGoude 2017-11-23 12:28:38 +01:00 committed by GitHub
parent 2746706e9e
commit f9bc97330a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,25 +214,25 @@ sudo sh -c "echo 'greeter-show-manual-login=true' | sudo tee -a /usr/share/light
sudo sh -c "echo 'allow-guest=false' | sudo tee -a /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf" sudo sh -c "echo 'allow-guest=false' | sudo tee -a /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf"
fi fi
clear clear
echo "If you have several domain controllers worldwide it is recomended to set your DC" #echo "If you have several domain controllers worldwide it is recomended to set your DC"
echo "" #echo ""
read -p "Do you wish to set your DC in configuration (y/n)?" yn #read -p "Do you wish to set your DC in configuration (y/n)?" yn
case $yn in #case $yn in
[Yy]* ) #[Yy]* )
echo "Type DC" #echo "Type DC"
read dcs #read dcs
ldaps=$( cat /etc/sssd/sssd.conf | grep -i $dcs | cut -d '/' -f3 ) #ldaps=$( cat /etc/sssd/sssd.conf | grep -i $dcs | cut -d '/' -f3 )
echo "" #echo ""
if [ "$ldaps" = "$dcs" ] #if [ "$ldaps" = "$dcs" ]
then echo "sssd seems already have $dcs configured.. skipping.." #then echo "sssd seems already have $dcs configured.. skipping.."
else #else
echo #echo
var=$( echo "ldap_uri = ldap://$dcs" ) #var=$( echo "ldap_uri = ldap://$dcs" )
sed -i '9i\'"$var"'' /etc/sssd/sssd.conf #sed -i '9i\'"$var"'' /etc/sssd/sssd.conf
fi;; #fi;;
[Nn]* ) echo "skipping...";; #[Nn]* ) echo "skipping...";;
* ) echo "Please awnser yes or No" ;; #* ) echo "Please awnser yes or No" ;;
esac #esac
sed -i -e 's/fallback_homedir = \/home\/%u@%d/#fallback_homedir = \/home\/%u@%d/g' /etc/sssd/sssd.conf sed -i -e 's/fallback_homedir = \/home\/%u@%d/#fallback_homedir = \/home\/%u@%d/g' /etc/sssd/sssd.conf
sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/g' /etc/sssd/sssd.conf sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/g' /etc/sssd/sssd.conf
sed -i -e 's/access_provider = ad/access_provider = simple/g' /etc/sssd/sssd.conf sed -i -e 's/access_provider = ad/access_provider = simple/g' /etc/sssd/sssd.conf