This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
# sudoでTouchIDが使えるようにする | |
if ! grep -Eq '^auth\s.*\spam_tid\.so$' /etc/pam.d/sudo; then | |
( set -e; set -o pipefail | |
# 最初の auth として pam_tid.so を追加 | |
pam_sudo=$(awk 'fixed||!/^auth /{print} !fixed&&/^auth/{print "auth sufficient pam_tid.so";print;fixed=1}' /etc/pam.d/sudo) | |
sudo tee /etc/pam.d/sudo <<<"$pam_sudo" |