summaryrefslogtreecommitdiff
path: root/passwort-tresor.in
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-08-19 11:18:33 +0200
committerErich Eckner <git@eckner.net>2016-08-19 11:18:33 +0200
commiteeb39874db4d83249aa3a6be7ef7e02c3bc63a81 (patch)
treecc378316a3fa281e575be8f8d750ac5912e6ee92 /passwort-tresor.in
parent2fdaecf3451e3f2a64e71092ccb57aae936340d5 (diff)
downloadpasswort-tresor-eeb39874db4d83249aa3a6be7ef7e02c3bc63a81.tar.xz
aufraeumen
Diffstat (limited to 'passwort-tresor.in')
-rwxr-xr-xpasswort-tresor.in29
1 files changed, 29 insertions, 0 deletions
diff --git a/passwort-tresor.in b/passwort-tresor.in
new file mode 100755
index 0000000..9d6d3c6
--- /dev/null
+++ b/passwort-tresor.in
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. #ETCDIR#/passwort-tresor.konf
+
+echo "Dienst: "
+read dienst
+
+tmpDir="$(mktemp -d)"
+
+text="$(${passwortDateiBefehl} | gpg -o - -d - 2> "${tmpDir}/")"
+
+if [ ! $(grep -c "Good signature from \"Erich Eckner \([^\"]*\)\?<erich@eckner.net>\"" ${tmpMsg}) -eq 1 ] || [ ! $(grep -c "Signature made .* using RSA key ID 0AEEC90755DA7B5A" ${tmpMsg}) -eq 1 ]
+then
+ dialog --textbox ${tmpMsg} 14 70
+fi
+
+rm -f ${tmpMsg}
+
+[ $(echo -e "${text}" | grep -c "${dienst}") -gt 1 ] && dienst="^${dienst}"
+[ $(echo -e "${text}" | grep -c "${dienst}") -gt 1 ] && dienst="${dienst}:\$"
+[ $(echo -e "${text}" | grep -c "${dienst}") -eq 1 ] || exit 1
+
+text="$(echo "${text}" | grep -2 "${dienst}" | tail -n2)"
+echo "${text}" | head -n1 | xclip -i
+echo -n "."
+read dienst
+echo "${text}" | tail -n1 | xclip -i
+echo -n "."
+read dienst