summarylogtreecommitdiffstats
path: root/pi-hole-server.install
blob: a1c7ee81eb7b4d1867a924ad2eeda758a0b6abcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
post_install() {
  echo -e "\e[1;33m==>\e[0m Please read configuration instructions at /usr/share/doc/pihole/configuration"
  echo -e "\e[1;33m==>\e[0m \e[1;31mVer. 2.9.5-1\e[0m: dnsmasq and lighttpd conf files are changed"
  echo -e "\e[1;33m==>\e[0m \e[1;31mAttention\e[0m: dnsmasq config files used are now two and both mandatory."
  echo -e "\e[1;33m==>\e[0m Pay attention to the name of the destination dnsmasq include config file"
  echo -e "\e[1;33m==>\e[0m Please follow configuration upgrade steps"
  echo -e "\e[1;33m==>\e[0m Neutrino emissions detected..."
  [ -e /proc/net/if_inet6 ] && touch /etc/pihole/.useIPv6  #this will be obsoleted soon
  chown -R http.http /srv/http/pihole
  systemd-tmpfiles --create pi-hole.conf
  /opt/pihole/mimic_setupVars.conf.sh
  /usr/bin/pihole updateGravity > /dev/null
  systemctl daemon-reload > /dev/null
  systemctl is-active pi-hole-logtruncate.timer 2>&1 >/dev/null || systemctl start pi-hole-logtruncate.timer
  systemctl is-active pi-hole-gravity.timer 2>&1 >/dev/null || systemctl start pi-hole-gravity.timer
}

post_upgrade() {
  [ -e /etc/pihole/hosts ] && rm /etc/pihole/hosts
  [ -e /etc/pihole/.useIPv6 ] && rm /etc/pihole/.useIPv6
  post_install $1
}

post_remove() {
  rm -R /etc/pihole/
  rm /run/log/pihole.log
}