From e3dba9fb736330878caf947e39171455c5b3044f Mon Sep 17 00:00:00 2001 From: blueingreen68 Date: Tue, 23 Jan 2024 14:12:51 +0500 Subject: update getKeepassFile.sh --- cloneDotfiles.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 cloneDotfiles.sh (limited to 'cloneDotfiles.sh') diff --git a/cloneDotfiles.sh b/cloneDotfiles.sh new file mode 100755 index 0000000..a1fbf6e --- /dev/null +++ b/cloneDotfiles.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +setStatusE () { + if [ "$1" = true ]; then + set +e + else + set -e + fi +} + +setStatusE false + +getKdbxFile () { + read -r passwordFileLink < <(yadisk-direct https://yadi.sk/d/o4TMFnHFobxTsw) + + wget "$passwordFileLink" -O ~/Passwords.kdbx +} + +openKeepass () { + setStatusE true + + keepassxc-cli clip ~/Passwords.kdbx github 0 -a token-cli +} + +cat << EOF +Before start ./cloneDotfiles.sh: + +pipx install wldhx.yadisk-direct +pipx ensurepath +source .bashrc + +and launch ./cloneDotfiles.sh in new foot window +EOF + +getKdbxFile + +while : +do + openKeepass + + if [ $? -eq 0 ]; then + setStatusE false + echo -e "Пароль скопирован!\n" + break + fi +done + +cd +git clone https://blueingreen68@github.com/blueingreen68/dotfiles $HOME/.dotfiles +wl-copy -c -- cgit