First off, thanks for such a great product!!
I have started to build and install these. I used to have a standard image that went out with a static IP address. This works well until the router address jumps from say 192.168.0.1 to 192.168.2.1. Then, the device is offline, and I can not finish setup remotely.
My fix is to let it get a dynamic IP, and while remotely logged into their network/PC, find the pihole. SSH in, set proper static, and I'm done. I just realized on some units however I was having slow response times for blocked sites, instead of instant. I also noticed that in the web UI, the IP address showing in settings was not correct. This is because the webUI (and also gravity.list) use the same IP as is set in /etc/pihole/setupVars.conf, which never changes from initial install.
My suggestion (and this may not be practical, or may break other things, etc) - have setupVars.conf be updated on each boot, before everything else fires up, to the current IP address. The only other issue is with gravity.list. It seems that the only way to fix that is a global IP address replace or pihole -r / -g (after fixing setupVars.conf).
Any way to make this a bit more automated? If it could be - this could be portable and seamlessly moved from network to network. It is currently portable, but gets broken on DNS resolution if IP address changes and needs a few manual fixes that cannot be accomplished via web UI.
EDIT: After a bit more thinking, it seems to me that the IP address in gravity.list is not even needed - on mine, the first column is ALWAYS the current IP address of the pihole. Unless it's possible to have different IP addresses for different blocked sites, it seems redundant. Couldn't the process reading gravity.list always pull the current IP address instead?
Manually, this seems to do it:
newip=ifconfig|grep broad|awk -F' ' '{print $2}'
oldip=grep IPV4 /etc/pihole/setupVars.conf |awk -F= '{print $2}'|awk -F/ '{print $1}'
sudo sed -i.bak 's/'"$oldip"'/'"$newip"'/g' /etc/pihole/setupVars.conf
oldip=head -1 /etc/pihole/gravity.list|awk -F' ' '{print $1}'
sudo sed -i.bak 's/'"$oldip"'/'"$newip"'/g' /etc/pihole/gravity.list
pihole restartdns