diff --git a/wordpress/deploy.sh b/wordpress/deploy.sh index 4f9befc..db15769 100755 --- a/wordpress/deploy.sh +++ b/wordpress/deploy.sh @@ -64,9 +64,8 @@ if [ ! -f "$SCRIPT_DIR/.env" ]; then # Generate random passwords for local dev ROOT_PASS=$(openssl rand -hex 16 2>/dev/null || cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1) WP_PASS=$(openssl rand -hex 16 2>/dev/null || cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n1) - sed -i "s/change-me-to-a-strong-password/${ROOT_PASS}/g" "$SCRIPT_DIR/.env" - # Second occurrence is MYSQL_PASSWORD - sed -i "0,/change-me-to-a-strong-password/{s/change-me-to-a-strong-password/${WP_PASS}/}" "$SCRIPT_DIR/.env" + sed -i "0,/change-me-to-a-strong-password/{s/change-me-to-a-strong-password/${ROOT_PASS}/}" "$SCRIPT_DIR/.env" + sed -i "s/change-me-to-a-strong-password/${WP_PASS}/" "$SCRIPT_DIR/.env" echo -e "${GREEN}✓${NC} Contraseñas generadas en ${SCRIPT_DIR}/.env" fi