Improve install
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
#! /bin/bash
|
||||
|
||||
export MASTERPW=$(gum input --header="Master password" --password)
|
||||
echo "-------------------------------------"
|
||||
echo "Password Setup Script"
|
||||
echo "-------------------------------------"
|
||||
|
||||
Enpass &
|
||||
|
||||
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=$(zenity --password)
|
||||
CHECKPW=$(enpass-cli -vault="$HOME/.local/share/Enpass/Enpass/Vaults/primary" -sort list)
|
||||
done
|
||||
|
||||
echo "Password set successfuly"
|
||||
if gum confirm "Do you need to change your password?"; then
|
||||
while true; do
|
||||
if passwd; then
|
||||
echo "Password successfully updated."
|
||||
break
|
||||
else
|
||||
echo "Failed to update password."
|
||||
|
||||
if ! gum confirm "Would you like to try again?"; then
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "Password change skipped."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user