24 lines
613 B
Bash
Executable File
24 lines
613 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$(bw status | jq -r '.status')" = "locked" ]; then
|
|
read -p "Bitwarden password: " password
|
|
|
|
token=$(eval "bw unlock $password --raw")
|
|
|
|
export BW_SESSION="$token"
|
|
fi
|
|
|
|
|
|
if ! [[ -d "./.passwords" ]]
|
|
then
|
|
mkdir "./.passwords"
|
|
echo "Created passwords directory"
|
|
fi
|
|
|
|
bw get password "ansible vault encryption" > ./.passwords/vault
|
|
echo "Fetched vault password"
|
|
bw get password "linux user ansible@bigboi" > ./.passwords/become
|
|
echo "Fetched ansible user password"
|
|
bw get password "linux user wholteza@bigboi" > ./.passwords/bootstrap_become
|
|
echo "Fetched bootstrap user password"
|