encrypted single-user key-value store
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get 352B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. set -euo pipefail
  3. VAULT=vault
  4. function main {
  5. if [ ! -f "$VAULT" ]; then
  6. echo 'error: no vault exists'
  7. exit 1
  8. fi
  9. KEY="$1"
  10. VALUE=$(gpg --decrypt "$VAULT" | jq ".$KEY")
  11. if [ "$VALUE" = "null" ]; then
  12. echo 'error: no key exists'
  13. exit 1
  14. else
  15. echo "$VALUE"
  16. fi
  17. }
  18. main "$@"