aboutsummaryrefslogtreecommitdiff
path: root/bin/setpass
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-10-27 18:25:42 +0100
committerHimbeer <himbeer@disroot.org>2024-10-27 18:50:16 +0100
commit7a668d965b9949a6122460ed1ed749636a41bbe7 (patch)
treeb26e3238c11a80df489eedd3a4de37e485375a99 /bin/setpass
parent464cfebc6f4bd53f2959b3fe9b6e991bb271b002 (diff)
Add command-line password store utilities
Diffstat (limited to 'bin/setpass')
-rwxr-xr-xbin/setpass10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/setpass b/bin/setpass
new file mode 100755
index 0000000..2e8f7b8
--- /dev/null
+++ b/bin/setpass
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+(umask 4177 && touch ~/.passdb)
+
+cp -p ~/.passdb ~/.passdb.old
+grep --color=never -ve "^$1 = " ~/.passdb.old > ~/.passdb
+
+if [ -n "$2" ]; then
+ echo "$1 = $2" >> ~/.passdb
+fi