chore: test for gdm-password alternative in utility scripts

This commit is contained in:
Michel Decima
2021-10-22 14:38:31 +02:00
parent eb76edda07
commit 53c655eef4
2 changed files with 15 additions and 5 deletions

View File

@@ -6,11 +6,17 @@
(( EUID == 0 )) || { echo >&2 "Not root." ; exit 1 ; } (( EUID == 0 )) || { echo >&2 "Not root." ; exit 1 ; }
update-alternatives --set gdm-smartcard /etc/pam.d/gdm-smartcard-sssd-or-password if [ -e /etc/pam.d/gdm-smartcard-sssd-or-password ] ; then
sed -Ei 's/(enable-smartcard-authentication)=.*/\1=false/' /etc/dconf/db/gdm.d/03-smartcard update-alternatives --set gdm-smartcard \
/etc/pam.d/gdm-smartcard-sssd-or-password
fi
sed -Ei 's/(enable-smartcard-authentication)=.*/\1=false/' \
/etc/dconf/db/gdm.d/03-smartcard
dconf update dconf update
systemctl enable sssd.service sssd-pam.socket systemctl enable sssd.service sssd-pam.socket
systemctl start sssd.service systemctl start sssd.service || exit 1
cat << EOF cat << EOF
Please restart desktop manager with command: Please restart desktop manager with command:

View File

@@ -6,8 +6,12 @@
(( EUID == 0 )) || { echo >&2 "Not root." ; exit 1 ; } (( EUID == 0 )) || { echo >&2 "Not root." ; exit 1 ; }
update-alternatives --set gdm-smartcard /etc/pam.d/gdm-smartcard-pkcs11-exclusive update-alternatives --set gdm-smartcard \
sed -Ei 's/(enable-smartcard-authentication)=.*/\1=true/' /etc/dconf/db/gdm.d/03-smartcard /etc/pam.d/gdm-smartcard-pkcs11-exclusive \
|| { echo >&2 "Cannot switch to PKI login (GDM too old?)" ; exit 1 ; }
sed -Ei 's/(enable-smartcard-authentication)=.*/\1=true/' \
/etc/dconf/db/gdm.d/03-smartcard
dconf update dconf update
cat << EOF cat << EOF