summaryrefslogtreecommitdiff
path: root/wr/rdsec
diff options
context:
space:
mode:
authorGeorge Abbott <george@gabbott.dev>2023-10-31 17:54:07 +0000
committerGeorge Abbott <george@gabbott.dev>2023-10-31 17:54:07 +0000
commit4d0bd914e7c1ee65f4036e60149a7b891906a5d3 (patch)
treec2a6751823e064e003cd4f6166df07bfc106d7eb /wr/rdsec
Commit all to date.
Diffstat (limited to 'wr/rdsec')
-rwxr-xr-xwr/rdsec8
1 files changed, 8 insertions, 0 deletions
diff --git a/wr/rdsec b/wr/rdsec
new file mode 100755
index 0000000..21ba438
--- /dev/null
+++ b/wr/rdsec
@@ -0,0 +1,8 @@
+#!/bin/sh
+# rdsec: Read a secure entry, will NOT write it back after.
+
+[ ! -f "$HOME/docs/wr/sec/$1" ] && echo "File $1 does not exist" && return
+mkdir -p "/tmp/mksec"
+gpg -d --output "/tmp/mksec/$1.decrypted" "$HOME/docs/wr/sec/$1"
+nvim "/tmp/mksec/$1.decrypted"
+rm "/tmp/mksec/$1.decrypted"