Last active
December 4, 2020 15:14
-
-
Save frgaudet/fcb1375f93d04ef083a96038f76f2352 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# coding=utf-8 | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# <http://www.gnu.org/licenses/>. | |
# | |
# F-Gaudet 2018 | |
# Initial tip : http://www.unixfu.ch/how-to-authenticate-sudo-with-touchid/ | |
########## Use touchid for sudo - Add line after first comment | |
FILE="/etc/pam.d/sudo" | |
if [ -e $FILE ]; then | |
if [ $(grep -q "^auth sufficient pam_tid.so" $FILE;echo $?) == 1 ]; then | |
echo "Patching file" | |
sudo sed -i.bak '/^#/ a\ | |
auth sufficient pam_tid.so | |
' $FILE | |
fi | |
fi | |
########## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment