Update ADconnection.sh

This commit is contained in:
PierreGode 2020-03-27 09:04:53 +01:00 committed by GitHub
parent 099588f0eb
commit 004a872400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,6 +243,10 @@ sudo service sssd restart
sleep 1
clear
usesasl=$( sudo grep USESASL readfile | awk '{print $3}' )
if [ "$usesasl" = "no" ]
then
echo "Skipping SASL"
else
if [ "$usesasl" = "yes" ]
then
sasl=$( sudo grep LDAPS readfile | awk '{print $3}' )
@ -300,6 +304,7 @@ fi;;
* ) echo "Please answer yes or no.";;
esac
fi
fi
################################# Check #######################################
if ! sudo service sssd restart
then
@ -576,17 +581,21 @@ entry_cache_timeout = 600
entry_cache_nowait_percentage = 75 " | sudo tee -a /etc/sssd/sssd.alternatives
sudo service sssd restart
clear
usesasl=$( grep USESASL readfile | awk '{print $3}' )
usesasl=$( sudo grep USESASL readfile | awk '{print $3}' )
if [ "$usesasl" = "no" ]
then
echo "Skipping SASL"
else
if [ "$usesasl" = "yes" ]
then
sasl=$( grep LDAPS readfile | awk '{print $3}' )
sasl=$( sudo grep LDAPS readfile | awk '{print $3}' )
if [ "$sasl" = "null" ]
then
echo "You need to specify domaincontroller in readfile"
exit
else
echo "$sasl"
cacer=$( grep CACERT readfile | awk '{print $3}' )
cacer=$( sudo grep CACERT readfile | awk '{print $3}' )
if ! ls "$cacer"
then echo "No root CA found, check your path to file"
else
@ -613,7 +622,7 @@ echo "Found certificate $cacert"
read -r -p "Is this information correct (y/n)?" yn
case $yn in
[Yy]* )
tlsca=$( grep ldap_tls_cacert /etc/sssd/sssd.conf | awk '{print $1}' )
tlsca=$( sudo grep ldap_tls_cacert /etc/sssd/sssd.conf | awk '{print $1}' )
if [ "$tlsca" = "ldap_tls_cacert" ]
then
echo "ldap_tls_cacert already in file"
@ -634,6 +643,7 @@ fi;;
* ) echo "Please answer yes or no.";;
esac
fi
fi
####################### Check #########################
if ! sudo service sssd restart
then