aboutsummaryrefslogtreecommitdiff
path: root/bin/setpass
diff options
context:
space:
mode:
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