summaryrefslogtreecommitdiff
path: root/contrib/importers/pwsafe2pass.sh
blob: 8e9374561c568fdebb7e92bcee7e35b4d4dd937f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Copyright (C) 2013 Tom Hendrikx <tom@whyscream.net>. All Rights Reserved.
# This file is licensed under the GPLv2+. Please see COPYING for more information.

export=$1

IFS="	" # tab character
cat "$export" | while read uuid group name login passwd notes; do
     test "$uuid" = "# passwordsafe version 2.0 database" && continue
     test "$uuid" = "uuid" && continue
     test "$name" = '""' && continue;

     group="$(echo $group | cut -d'"' -f2)"
     login="$(echo $login | cut -d'"' -f2)"
     passwd="$(echo $passwd | cut -d'"' -f2)"
     name="$(echo $name | cut -d'"' -f2)"

     # cleanup
     test "${name:0:4}" = "http" && name="$(echo $name | cut -d'/' -f3)"
     test "${name:0:4}" = "www." && name="$(echo $name | cut -c 5-)"

     entry=""
     test -n "$login" && entry="${entry}login: $login\n"
     test -n "$passwd" && entry="${entry}pass: $passwd\n"
     test -n "$group" && entry="${entry}group: $group\n"

     echo Adding entry for $name:
     echo -e $entry | pass insert --multiline --force "$name"
     test $? && echo "Added!"
done
c12b617da5d68288&follow=1'>Issue #46: Fix semantics of `n` resultRené 'Necoro' Neumann2-9/+15 2021-02-16Issue #46: Move and rename writer; add commentsRené 'Necoro' Neumann3-12/+21 2021-02-15Issue #46: Improvements; add testsRené 'Necoro' Neumann2-1/+48 2021-02-15Bump github.com/google/uuid from 1.1.4 to 1.2.0dependabot[bot]2-3/+3 2021-02-15Issue #46: Make the resulting email body not to include single \r or \n. This...René 'Necoro' Neumann2-2/+66 2021-01-20Bump github.com/PuerkitoBio/goquery from 1.6.0 to 1.6.1dependabot[bot]2-3/+3 2021-01-09Bump github.com/google/uuid from 1.1.2 to 1.1.4dependabot[bot]2-3/+3 2021-01-09Bump github.com/emersion/go-message from 0.14.0 to 0.14.1 (#42)dependabot[bot]2-3/+3 2020-11-28Bump github.com/emersion/go-message from 0.13.0 to 0.14.0 (#38)dependabot[bot]2-3/+9 2020-11-28Bump github.com/google/go-cmp from 0.5.2 to 0.5.4 (#37)dependabot[bot]2-3/+3 2020-11-23Fix release.ymlv0.5.2René 'Necoro' Neumann1-3/+10 2020-11-23Prepare v0.5.2René 'Necoro' Neumann3-3/+8 2020-11-20Bump github.com/gabriel-vasile/mimetype from 1.1.1 to 1.1.2dependabot[bot]2-3/+3 2020-11-04Clean dependabot.ymlRené 'Necoro' Neumann1-4/+0