34 lines
957 B
Bash
34 lines
957 B
Bash
|
|
#! /bin/bash
|
||
|
|
|
||
|
|
echo "-------------------------------------"
|
||
|
|
echo "Enpass Setup Script"
|
||
|
|
echo "-------------------------------------"
|
||
|
|
|
||
|
|
export MASTERPW=$(gum input --header="Enpass Master password" --password)
|
||
|
|
|
||
|
|
echo "https://tower.scarif.space" | wl-copy
|
||
|
|
|
||
|
|
Enpass &
|
||
|
|
|
||
|
|
zenity --title="Enpass Setup" \
|
||
|
|
--info \
|
||
|
|
--text="Tower URL copied.\nPress OK when it asks for master password" \
|
||
|
|
|| gum confirm "You closed the dialog, do you want to continue?" \
|
||
|
|
|| exit 1
|
||
|
|
|
||
|
|
echo "$MASTERPW" | wl-copy
|
||
|
|
|
||
|
|
read -n 1 -r -s -p $'Press enter when you have synced enpass...\n'
|
||
|
|
|
||
|
|
wl-copy --clear
|
||
|
|
|
||
|
|
CHECKPW=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort list 2>&1)
|
||
|
|
|
||
|
|
while [[ "$CHECKPW" == *level=fatal* ]]; do
|
||
|
|
export MASTERPW=$(gum input --header="Enpass Master password (incorrect, try again)" --password")
|
||
|
|
CHECKPW=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort list)
|
||
|
|
done
|
||
|
|
|
||
|
|
echo "Password set successfuly"
|
||
|
|
|