File: bird2.postinst

package info (click to toggle)
bird2 2.18-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,644 kB
  • sloc: ansic: 75,250; sh: 3,807; perl: 3,444; lex: 887; xml: 520; makefile: 511; python: 495; sed: 13
file content (31 lines) | stat: -rw-r--r-- 690 bytes parent folder | download
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
31
#!/bin/sh
set -e

upgrade_cleanup() {
  [ "$2" ] || return 0

  dpkg --compare-versions $2 lt 2.17.3-1~ || return 0

  dpkg-statoverride --remove /etc/bird >/dev/null 2>/dev/null || true
  dpkg-statoverride --remove /etc/bird/bird.conf >/dev/null 2>/dev/null || true

  if command -v ucf > /dev/null; then
    ucf --purge /etc/bird/bird.conf
    ucfr --purge bird2 /etc/bird/bird.conf
  fi

  # update-rc.d removes symlinks even if LSB initscript exists, contrary to
  # update-rc-d(8). See #680293. Can be removed once it is fixed.
  [ -f /etc/init.d/bird ] && return 0
  update-rc.d bird remove || true
}

case "$1" in
  upgrade)
    upgrade_cleanup "$@"
    ;;
esac

#DEBHELPER#

exit 0