summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-29 16:34:27 -0400
committerAndrew Cady <d@jerkface.net>2016-04-29 16:34:27 -0400
commitff4026a382372c200ffa6d98aa2b18440b25bd2d (patch)
tree68012c85d19ba7524892c28e3d1f3c9e29c68c24
parent0d7e02085f4b6e0e5d7a9e411b1a0f7269be80e1 (diff)
avoid expect
-rwxr-xr-xsrc/keygen.sh21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/keygen.sh b/src/keygen.sh
index 716359b..801010a 100755
--- a/src/keygen.sh
+++ b/src/keygen.sh
@@ -2,24 +2,9 @@
2 2
3gpg_set_ultimate_trust() 3gpg_set_ultimate_trust()
4{ 4{
5 local keygrip 5 local keygrip d
6 keygrip=$(gpg -K --with-colons|sed -ne '/^sec:/{p;q}'|cut -d: -f5) || return 6 keygrip=$(gpg -K --with-colons --with-fingerprint --with-fingerprint|sed -ne '/^sec/{n;p;q}'|cut -d: -f10)
7 7 printf '%s:6:\n' "$keygrip" | gpg2 --import-ownertrust
8 expect - -- "$keygrip" <<'END'
9
10 set keygrip "[lindex $argv 0]"
11
12 spawn gpg --edit-key "$keygrip" trust
13
14 expect "Your decision?"
15 send -- "5\n"
16 expect "Do you really want to set this key to ultimate trust?"
17 send -- "y\n"
18 expect "gpg>"
19 send -- "save\n"
20 send_tty "\r"
21
22END
23} 8}
24 9
25add() 10add()