Last active
April 18, 2016 20:41
s3cmd helper script to prompt for GPG passphrase for encrypting/decrypting
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
#!/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