Skip to content

Instantly share code, notes, and snippets.

@DavidWittman

DavidWittman/s3cmdcrypt.sh

Last active Apr 18, 2016
Embed
What would you like to do?
s3cmd helper script to prompt for GPG passphrase for encrypting/decrypting
#!/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
You can’t perform that action at this time.