Browse Source

kek

Signed-off-by: fbt <fbt@fleshless.org>
master
Jack L. Frost 4 years ago
parent
commit
0a6f588677
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      jspass

+ 10
- 4
jspass View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash-hammer
#export IFS='\t\n'
set +e
require /system
@ -64,7 +65,7 @@ esac
case "${Opts[action]:-show}" in
(new) check_argn "${#@}" 1 1;
vault="$1"
# Check if the damn thing already exists
vault_exists "$vault" && System.die 1 "Vault '$vault' already exists"
@ -87,14 +88,19 @@ case "${Opts[action]:-show}" in
}
;;
(show) check_argn "${#@}" 1 2;
(show) check_argn "${#@}" 1;
vault=$1
field=${2:-password}
for i in "${@:2}"; do
items+=( -e "$i" )
done
[[ "$items" ]] || items=( -e 'password' )
vault_exists "$vault" || System.die 1 "Vault does not exist: $1"
if vault_is_json "$vault"; then
pass=$(pass "$vault" | jshon -e "$field" -u) || {
pass=$(pass "$vault" | jshon "${items[@]}" -u) || {
System.die $? "Failed to extract json data from $vault/$field"
}
else


Loading…
Cancel
Save