commit 9accb8e941495a87e9ea7f743d9ef1b3c788de31 (patch)
Author: Alex Karle <firstname.lastname@example.org>
Date: Wed, 27 May 2020 20:32:09 -0400
bin: Add psync, a tool to sync pash passwords
pash is a simple password manager that stores each password as a GPG
encrypted key (see submodules for link). I like to backup to a central,
always on, host in my apartment (defaulting to a raspberry pi) so that
I can easily transfer passwords between my desktop and laptop.
There's a slight chance of password loss with the "sync" action (i.e.
someone else updated a password that you have a stale copy of), so it
defaults to needing to specify push/pull/sync for safety.
|A||bin/psync|| | ||30||++++++++++++++++++++++++++++++|
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/bin/psync b/bin/psync
@@ -0,0 +1,30 @@
+# Synchronize pash passwords with a central host
+ echo "$1" 1>&2
+ exit 1
+ rsync -av $HOME/.local/share/pash/ $PUSER@$PHOST:.local/share/pash/
+ rsync -av $PUSER@$PHOST:.local/share/pash/ $HOME/.local/share/pash/
+ # Assume current passwords are latest (push then pull)
+case "$1" in
+ push) push ;;
+ pull) pull ;;
+ sync) sync ;;
+ *) die "usage: psync push|pull|sync"