#!/bin/bash set -o pipefail echo "Modifying /etc/sssd/sssd.conf file" if ! grep -q ^ldap_user_extra_attrs /etc/sssd/sssd.conf; then sed -i '/ldap_tls_cacert/a ldap_user_extra_attrs = mail:mail, sn:sn, givenname:givenname, telephoneNumber:telephoneNumber' /etc/sssd/sssd.conf fi if ! grep -q ^user_attributes /etc/sssd/sssd.conf; then sed -i '/allowed_uids/a user_attributes = +mail, +telephoneNumber, +givenname, +sn' /etc/sssd/sssd.conf fi systemctl restart sssd sss_cache -E echo "Creating /etc/pam.d/keycloak file for PAM" cat >/etc/pam.d/keycloak <