Just to expand on this, create /etc/pihole/setupVars.conf (as is now documented here)
Then you should be able to run
curl -L https://install.pi-hole.net | bash /dev/stdin --unattended
The script will consume the variables you have set in setupVars.conf instead of asking you for new ones.