0

I would like to install Pi-Hole automatically inside Vagrant (Virtual Box). Therefore, inside an automated script, it has to run to box start. Unfortunately, normally, you have to answer multiple installation questions to finally install Pi-Hole, e.g. IPv4 or 6, ..., and you need keyboard interaction with the setup (by the user).

Is there any way or solution to install it without any interaction? How to write it down in a Bash script or Vagrantfile?

1

This discussion says you can create the configuration options in the file /etc/pihole/setupVars.conf (documented here) and run with the --unattended flag, eg:

curl -L https://install.pi-hole.net | bash /dev/stdin --unattended
  • Do you know by any chance what kind of hash is supposed to be used in WEBPASSWORD var? – Drew Apr 24 '18 at 20:42
  • Judging from the example and this source file, it is created with hash('sha256',hash('sha256',$_POST["pw"])). – meuh Apr 24 '18 at 20:52
  • so for example the output of echo -n P@ssw0rd | sha256sum, which is b03ddf3ca2e714a6548e7495e2a03f5e824eaac9837cd7f159c67b90fb4b7342 should set the pihole web interface password to P@ssw0rd... Wondering, why it might not work... – Drew Apr 24 '18 at 22:03
  • I guess because it's a double hash... Should be echo -n P@ssw0rd | sha256sum | cut -d ' ' -f 1 | sha256sum – Drew Apr 24 '18 at 22:12
  • Nope... Still doesn't work ((( – Drew Apr 24 '18 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.