Only allow fingerprint setup if a sensor is detected

This commit is contained in:
David Heinemeier Hansson
2025-07-09 20:46:43 -04:00
parent 6434fddb59
commit c567dbffaa

View File

@ -1,7 +1,10 @@
#!/bin/bash
yay -S --noconfirm --needed fprintd libfprint
yay -S --noconfirm --needed fprintd libfprint lsusb
if ! lsusb | grep -iq fingerprint; then
echo "No fingerprint sensor detected."
else
# Add fingerprint authentication as an option for sudo
if ! grep -q pam_fprintd.so /etc/pam.d/sudo; then
sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/sudo
@ -32,3 +35,4 @@ if fprintd-verify; then
else
echo -e "\e[31m\nSomething went wrong. Maybe try again?\e[0m"
fi
fi