2 # passman -- simple password manager
3 # Copyright (C) 2013-2021 Sergey Matveev (stargrave@stargrave.org)
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 3 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 gpg --armor --gen-random 1 16 | tr '+/' '-_' | tr -d =
24 xclip -in -selection $1
31 result=$(find . -type d -path "*$1*" | while read ent; do
32 [ -e "$ent/passwd" ] || continue
33 echo "$ent" | sed 's#^\./##'
35 if [ $(echo "$result" | wc -l) -ne 1 ]; then
39 [ -n "$result" ] || exit 1
55 [ -n "$passwd" ] || passwd=$(generator)
56 echo Adding password for $dst
59 echo "$passwd" > $DB/$dst/passwd
63 if [ -e "$ENTITY"/data ]; then
64 echo -n "Associated data: "
67 perl -ne 'chop and print' "$ENTITY"/passwd | cliper clipboard
68 echo $(basename "$ENTITY") | perl -ne 'chop and print' | cliper primary
70 echo -n | cliper clipboard