Use consistent bash5 style for conditionals and quoting
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
echo "Update polkit policy to yield to fingerprint and fido2"
|
||||
|
||||
# If fprint exists in polkit, it was wrong and needs reset
|
||||
if [ -f /etc/pam.d/polkit-1 ] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then
|
||||
if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then
|
||||
sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
|
||||
auth sufficient pam_fprintd.so
|
||||
auth required pam_unix.so
|
||||
@@ -13,9 +13,9 @@ EOF
|
||||
fi
|
||||
|
||||
# If fido2 is in sudo, it won't be in polkit either way
|
||||
if grep -q pam_u2f.so /etc/pam.d/sudo && [ -f /etc/pam.d/polkit-1 ] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then
|
||||
if grep -q pam_u2f.so /etc/pam.d/sudo && [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then
|
||||
sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1
|
||||
elif grep -q pam_u2f.so /etc/pam.d/sudo && [ ! -f /etc/pam.d/polkit-1 ]; then
|
||||
elif grep -q pam_u2f.so /etc/pam.d/sudo && [[ ! -f /etc/pam.d/polkit-1 ]]; then
|
||||
sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF'
|
||||
auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2
|
||||
auth required pam_unix.so
|
||||
|
||||
Reference in New Issue
Block a user