diff options
Diffstat (limited to 'zsh/functions/vault')
| -rw-r--r-- | zsh/functions/vault | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/zsh/functions/vault b/zsh/functions/vault new file mode 100644 index 0000000..abe0158 --- /dev/null +++ b/zsh/functions/vault @@ -0,0 +1,14 @@ +# -*- mode: sh -*- + +case $1 in + close) + hdiutil unmount -quiet $2 + ;; + open) + op get item ${2:t} --fields password --session $(op signin --raw) \ + | hdiutil attach -quiet -stdinpass $2 + ;; + *) + return 1 + ;; +esac |
