Hello, my script continously asking for user password id blank is left empty ! any idea to fix it:
# Password validation loop.
TRY=1
until /usr/bin/dscl /Search -authonly "$user" "$USER_PASS" &>/dev/null; do
(( TRY++ ))
echo "Prompting $user for their Mac password (attempt $TRY)..."
USER_PASS=$(osascript -e 'tell application "System Events" to display dialog "Please, type your Password to start the operation:" default answer "" with title "test" with hidden answer buttons {"OK"} default button 1' -e 'text returned of result' 2>/dev/null)
if (( TRY >= 5 )); then
echo "[ERROR] Password prompt unsuccessful after 5 attempts. Exiting script..."
exit 1
fi
done