Last active
April 18, 2016 20:41
-
-
Save DavidWittman/c003fc619e6abc4f65f65a4ece3a4fef to your computer and use it in GitHub Desktop.
s3cmd helper script to prompt for GPG passphrase for encrypting/decrypting
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
#!/usr/bin/env bash | |
# s3cmd helper script to prompt for GPG passphrase for encrypting/decrypting | |
S3CMD_CONFIG=${S3CMD_CONFIG:-"$HOME/.s3cfg"} | |
S3CMD="$(which s3cmd)" | |
if [[ -z "$GPG_PASSPHRASE" ]]; then | |
# Add the -s flag here to hide the passphrase | |
read -r -p "Encryption passphrase: " GPG_PASSPHRASE | |
fi | |
"$S3CMD" -c <(cat "$S3CMD_CONFIG"; echo gpg_passphrase="$GPG_PASSPHRASE") -e "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment