Skip to content

Instantly share code, notes, and snippets.

@Pyppe
Last active August 29, 2015 14:08
Show Gist options
  • Save Pyppe/53f71017b0c11043b6ea to your computer and use it in GitHub Desktop.
Save Pyppe/53f71017b0c11043b6ea to your computer and use it in GitHub Desktop.
plz-sudo() {
local pass=`gimme-passwd`
echo $pass | sudo -S "$@"
}
gimme-passwd() {
local GPG_PASS_FILE="/home/pyppe/password.txt.gpg"
read -sp "Enter passphrase: " gpgpass
echo "${gpgpass}" | gpg --yes --no-tty --batch --passphrase-fd 0 -o- $GPG_PASS_FILE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment