aboutsummaryrefslogtreecommitdiff
path: root/getKeepassFile.sh
blob: 153d30211cd23a31cbd7c187e7de5dd830a3b6b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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
}

# pipx install wldhx.yadisk-direct
# pipx ensurepath
# source ~/.bashrc

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