71 lines
1.6 KiB
Bash
Executable File
71 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
export DISPLAY="${DISPLAY:-:0}"
|
|
|
|
# Source dialog interface for cross-platform compatibility
|
|
source "${0%/*}/../.includes/dialog-interface.sh"
|
|
|
|
# Detect dialog interface type
|
|
if [[ -z "$DISPLAY" ]]; then
|
|
dialogType="dialog"
|
|
else
|
|
dialogType="yad"
|
|
fi
|
|
|
|
agm_msgbox "Mist World Account Creator" "" "Select create account from the menu, then press OK to continue."
|
|
|
|
# Read email address
|
|
echo "Enter email address:"
|
|
read -r email
|
|
|
|
# Validate email address format
|
|
if [[ "$email" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$ ]]; then
|
|
# Type email address
|
|
xdotool type --delay=75 "$email"
|
|
# Press tab
|
|
xdotool sleep 0.5 key --delay=75 Tab
|
|
# Press enter
|
|
xdotool sleep 0.5 key --delay=75 Return
|
|
else
|
|
echo "Invalid email format. Exiting."
|
|
exit 1
|
|
fi
|
|
|
|
# Press tab
|
|
|
|
#xdotool sleep 0.5 key --delay=75 Tab
|
|
# Press enter
|
|
#xdotool sleep 0.5 key --delay=75 Return
|
|
|
|
echo "Please check your email for the verification code."
|
|
|
|
# Read verification code
|
|
echo "Enter verification code:"
|
|
read -r code
|
|
|
|
# Type verification code
|
|
xdotool type --delay=1000 $code
|
|
# press tab
|
|
xdotool sleep 0.5 key --delay=75 Tab
|
|
# Press enter
|
|
xdotool sleep 0.5 key --delay=75 Return
|
|
|
|
# Read password
|
|
echo "Enter password between 6 and 16 characters, 1 uppercase letter 1 number required:"
|
|
read -r password
|
|
|
|
# Type password
|
|
xdotool type --delay=500 "$password"
|
|
# Press tab
|
|
xdotool sleep 0.5 key --delay=75 Tab
|
|
# Type password again
|
|
xdotool sleep 0.5 type --delay=500 "$password"
|
|
# Press tab
|
|
xdotool sleep 0.5 key --delay=75 Tab
|
|
# Press enter
|
|
xdotool sleep 0.5 key --delay=75 Return
|
|
|
|
echo "Account created!"
|
|
|
|
exit 0
|