File: pdns-recursor.preinst

package info (click to toggle)
pdns-recursor 4.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 7,756 kB
  • sloc: cpp: 68,610; javascript: 26,596; sh: 4,673; makefile: 591; xml: 37
file content (30 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (2)
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
29
30
#!/bin/sh
set -e

delete_unchanged() {
  if [ -e "$1" ] && echo "$2 $1" | md5sum --check --status; then
    echo "Removing unchanged configuration file $1"
    rm -f "$1"
  fi
}

backup_conffile() {
  if [ -e "$1" ]; then
    echo "Moving configuration file $1 to $1.dpkg-bak"
    mv -f "$1" "$1".dpkg-bak
  fi
}

case "$1" in
  install|upgrade)
    # clean up files we no longer ship
    delete_unchanged "/etc/default/pdns-recursor" a09916ceb17db9a49ac8cfa84790bf3b
    delete_unchanged "/etc/default/pdns-recursor" 076b21b9b76d7ffecc918af47d2963c6
    backup_conffile "/etc/default/pdns-recursor"
    delete_unchanged "/etc/init.d/pdns-recursor" e2ea0586c3d99fdbafb76483a769b964
    delete_unchanged "/etc/init.d/pdns-recursor" fb608ec5edc3d068213bac3480782355
    backup_conffile "/etc/init.d/pdns-recursor"
  ;;
esac

#DEBHELPER#