From 5b4d9ec52beb8b2a671e0308f907022f056e32cb Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Mon, 12 Jun 2023 00:25:20 +0200 Subject: [PATCH] Detect if password database is not present --- .bin/save-passwddb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.bin/save-passwddb b/.bin/save-passwddb index c5b4386..5fbd0ad 100755 --- a/.bin/save-passwddb +++ b/.bin/save-passwddb @@ -8,4 +8,9 @@ # `systemctl --user enable save-passwddb.service` # `systemctl --user enable save-passwddb.timer` -rclone copy "$HOME/doc/passwd.kdbx" google-drive: +if [ -f "$HOME/doc/passswd.kdbx" ]; then + rclone copy "$HOME/doc/passwd.kdbx" google-drive: +else + echo "Password database not found, use 'rclone copy google-drive:passwd.kdbx $HOME/doc/passwd.kdbx' to restore" + exit 1 +fi