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
r number. r610@Devoty: necoro | 2008-01-14 17:05:42 +0100 Disabled saving of the queues r611@Devoty: necoro | 2008-01-14 17:08:53 +0100 Added the possibility to permanently en-/disable plugins r612@Devoty: necoro | 2008-01-14 17:14:09 +0100 adjust changelog and translations r613@Devoty: necoro | 2008-01-14 17:40:53 +0100 Dropdown should be localized too 2008-01-14 r605@Devoty: necoro | 2008-01-14 11:43:34 +0100Necoro2-26/+129 Updated shm module to version 1.1.4 2008-01-14 r603@Devoty: necoro | 2008-01-14 11:30:26 +0100Necoro4-26/+38 Improved 'update world'; really support new use defaults 2008-01-11 r598@Devoty: necoro | 2008-01-10 16:36:29 +0100Necoro4-10/+50 Handle the new useflag format correctly 2008-01-11 r597@Devoty: necoro | 2008-01-10 14:12:35 +0100Necoro1-3/+3 updated todo 2008-01-10 r595@Devoty: necoro | 2008-01-10 04:04:15 +0100Necoro1-52/+3 Re-Introduced etc-proposals 2008-01-09 r586@Devoty: necoro | 2008-01-09 14:54:18 +0100Necoro1-1/+1 Disabled catapult till it is really usable 2007-12-06 r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 Fixed desktop file 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108 Added scrollbars to update window