mirror of
https://github.com/10h30/kazewp.git
synced 2026-05-12 15:21:20 +09:00
Check if user input empty username
This commit is contained in:
@@ -176,7 +176,12 @@ install_site() {
|
||||
fi
|
||||
done
|
||||
|
||||
while true; do
|
||||
read -p "Enter admin username: " ADMIN_USER
|
||||
if validate_username "$ADMIN_USER"; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
read -s -p "Enter password (press Enter for random password): " ADMIN_PASSWORD
|
||||
echo
|
||||
|
||||
@@ -15,3 +15,11 @@ validate_email() {
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_username() {
|
||||
if [[ -z "$1" ]] || [[ "$1" =~ ^[[:space:]]*$ ]]; then
|
||||
echo -e "${RED}Username cannot be empty${NC}"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
@@ -7,7 +7,8 @@ wpcli() {
|
||||
echo "Waiting for MariaDB to be ready..."
|
||||
|
||||
while [ "$(docker inspect --format='{{.State.Health.Status}}' db_${DOMAIN})" != "healthy" ]; do
|
||||
echo "MariaDB is not healthy yet. Retrying..."
|
||||
#echo "MariaDB is not healthy yet. Retrying..."
|
||||
echo "Loading..."
|
||||
sleep 5
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user