diff --git a/gocrypt.bash b/gocrypt.bash index 1cc40ef..cdfa00c 100755 --- a/gocrypt.bash +++ b/gocrypt.bash @@ -79,6 +79,14 @@ gocrypt_delegate() { pass git commit -m "Encrypted pass operation inside gocrypt" "$gocrypt_dir" || echo "No git commit created" } +gocrypt_crypt() { + gocrypt_open_check + [ ! -f "$1.gpg" ] && gocrypt_die "Not found: $1" + cmd_show "$1" | EDITOR=tee gocrypt_delegate edit "$1" + cmd_delete -f "$1" + echo "Moved $1 into encrypted storage" +} + gocrypt_help() { printf "%s" "\ $PROGRAM gocrypt - hide part of the password store in a subdirectory encrypted with gocryptfs @@ -100,6 +108,11 @@ usage $PROGRAM gocrypt close Unmount the encrypted subtree, if it was opened before. + $PROGRAM gocrypt crypt + Move a password from the original password store to the encrypted subdirectory. Note + that if you use git, this will still leave a record in the git repository of the original password + store. + $PROGRAM gocrypt help Print this help message. @@ -145,6 +158,10 @@ case "$1" in shift gocrypt_open $@ ;; + crypt) + shift + gocrypt_crypt $@ + ;; close) shift gocrypt_close $@