Improving scripts

This commit is contained in:
2026-03-14 19:15:38 +00:00
parent 23bbbbdbe8
commit 2de91ed77b
4 changed files with 76 additions and 104 deletions

View File

@@ -4,38 +4,39 @@ echo "-------------------------------------"
echo "Enpass Setup Script"
echo "-------------------------------------"
export MASTERPW=$(gum input --header="Enpass Master password" --password)
if [[ -z $MASTERPW ]]; then
export MASTERPW=$(gum input --header="Enpass Master password" --password)
fi
echo "stofflees@gmail.com" | wl-copy
VAULT_DIR="$HOME/.local/share/Enpass/Enpass/Vaults/primary"
station-launch-password-manager
if [ -f "$VAULT_DIR/vault.enpassdb" ]; then
echo "Vault already exists, skipping Enpass setup."
else
echo -n "stofflees@gmail.com" | wl-copy
zenity --title="Enpass Setup" \
--info \
--text="Email copied.\nPress OK when it asks for webdav URL" \
|| gum confirm "You closed the dialog, do you want to continue?" \
|| exit 1
station-launch-password-manager
echo "https://tower.scarif.space" | wl-copy
zenity --title="Enpass Setup" \
--info \
--text="Email copied.\nPress OK when it asks for webdav URL" \
|| gum confirm "You closed the dialog, do you want to continue?" \
|| exit 1
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 -n "https://tower.scarif.space" | wl-copy
echo "$MASTERPW" | wl-copy
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
read -n 1 -r -s -p $'Press enter when you have synced enpass...\n'
echo -n "$MASTERPW" | wl-copy
wl-copy --clear
read -n 1 -r -s -p $'Press enter when you have synced enpass...\n'
CHECKPW=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort list 2>&1)
wl-copy --clear
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"
echo "Enpass setup complete."
fi