decrypt-dir (274B)
1 #!/usr/bin/env bash 2 if ! command -v gpg &>/dev/null; then 3 echo "gpg not installed." >&2 4 exit 1 5 fi 6 7 if [ ! -z "$2" ]; then 8 mkdir -p "$2" 9 gpg --decrypt "$1" | tar xz -C "$2" 10 echo "Decrypted $1 into $2" 11 else 12 gpg --decrypt "$1" | tar xz 13 echo "Decrypted $1 into ./" 14 fi