|
|
@ -6,11 +6,14 @@ function reveal {
|
|
|
|
OPTIND=1
|
|
|
|
OPTIND=1
|
|
|
|
local homedir=""
|
|
|
|
local homedir=""
|
|
|
|
local passphrase=""
|
|
|
|
local passphrase=""
|
|
|
|
|
|
|
|
local force=0
|
|
|
|
|
|
|
|
|
|
|
|
while getopts "hd:p:" opt; do
|
|
|
|
while getopts "hfd:p:" opt; do
|
|
|
|
case "$opt" in
|
|
|
|
case "$opt" in
|
|
|
|
h) _show_manual_for "reveal";;
|
|
|
|
h) _show_manual_for "reveal";;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f) force=1;;
|
|
|
|
|
|
|
|
|
|
|
|
p) passphrase=$OPTARG;;
|
|
|
|
p) passphrase=$OPTARG;;
|
|
|
|
|
|
|
|
|
|
|
|
d) homedir=$OPTARG;;
|
|
|
|
d) homedir=$OPTARG;;
|
|
|
@ -26,7 +29,12 @@ function reveal {
|
|
|
|
while read line; do
|
|
|
|
while read line; do
|
|
|
|
local encrypted_filename=$(_get_encrypted_filename "$line")
|
|
|
|
local encrypted_filename=$(_get_encrypted_filename "$line")
|
|
|
|
|
|
|
|
|
|
|
|
local base="$SECRETS_GPG_COMMAND --use-agent -q --decrypt --yes"
|
|
|
|
local base="$SECRETS_GPG_COMMAND --use-agent -q --decrypt"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [[ "$force" -eq 1 ]]; then
|
|
|
|
|
|
|
|
base="$base --yes"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [[ ! -z "$homedir" ]]; then
|
|
|
|
if [[ ! -z "$homedir" ]]; then
|
|
|
|
base="$base --homedir=$homedir"
|
|
|
|
base="$base --homedir=$homedir"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|