Fresh Install via pihole -r

Stealing an idea from myself, and from another thread,,,,,

So if the end-user is running the master branch, and they accidentally break something,,
running pihole checkout master will potentially repair better than pihole -r

Additionally it's been pointed out that navigating to /var/www/html/admin and running sudo git reset --hard , will fix the webui (if that's the issue).

I recently had to redo my pihole, because i broke things so bad. (I can never stop tinkering). I wish I had thought to do the checkout command to redownload the repository.

This prompted me with an idea for pihole -r to have a third option to "fresh start reinstall".

This would:

  • create a "teleport" and ask if the user wishes to retain the adlists, whitelist, and blacklist files.
  • move all the pihole files to a temporary directory,
  • re-download the repositories,
  • apply a fresh lighttpd conf,

and if an error occurs during this process offer an option to either:

  • revert the changes by moving things back from the temporary directory,
  • or to remove the files from the temporary directory.