post_install() { echo -e "\e[1;33m==>\e[0m Read setup instructions at \e[1;36mhttps://wiki.archlinux.org/index.php/Pi-hole\e[0m" echo -e "\e[1;33m==>\e[0m Generating initial block list, please wait...\e[0m" chown -R http:http /srv/http/pihole /opt/pihole/mimic_setupVars.conf.sh _dnsmasq_address_setup # best solution to managing script-created files I can think of # is to install them to /usr/share/pihole/configs/ using sed magic # and copy them into /etc/dnsmasq.d/ on the first install only # from then on users can edit these and not have them overwritten # by an update install -Dm644 /usr/share/pihole/configs/01-pihole.example.conf /etc/dnsmasq.d/01-pihole.conf install -Dm644 /usr/share/pihole/configs/02-pihole.example.conf /etc/dnsmasq.d/02-pihole.conf # update lists on first run pihole -g > /dev/null } post_upgrade() { # clean old/unused/deprecated files [ -e /etc/pihole/hosts ] && rm /etc/pihole/hosts [ -e /etc/pihole/.useIPv6 ] && rm /etc/pihole/.useIPv6 # if neither file is present, bash throws an non-0 exit return 0 } post_remove() { [ -e /run/log/pihole/pihole.log ] && rm /run/log/pihole/pihole.log # delete all temp files except those modified the user # TODO - make this more intelligent to save *.pacsave.# where # is a number find /etc/pihole -type f ! -name '*.pacsave' ! -name 'pihole-FTL.conf' ! -name 'pihole-FTL.db' -delete } _dnsmasq_address_setup() { # official code here . /etc/pihole/setupVars.conf dnsmasq_pihole_conf=/usr/share/pihole/configs/02-pihole.example.conf if [[ -f /etc/hostname ]]; then hostname=$(