Skip to content

Instantly share code, notes, and snippets.

@frgaudet
Last active December 4, 2020 15:14
Show Gist options
  • Save frgaudet/fcb1375f93d04ef083a96038f76f2352 to your computer and use it in GitHub Desktop.
Save frgaudet/fcb1375f93d04ef083a96038f76f2352 to your computer and use it in GitHub Desktop.
#!/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