1 #! /bin/sh
2 # config script for collectd
3 #
4 # see: dh_installdebconf(1)
6 set -e
8 # summary of how this script can be called:
9 # * <preconfigure> `configure' <installed-version>
10 # * <postinst> `configure' <old-version>
11 # * <reconfigure> `reconfigure' <installed-version>
13 . /usr/share/debconf/confmodule
15 case "$1" in
16 configure)
17 db_set collectd/auto-migrate-3-4 false
19 if dpkg --compare-versions "$2" lt-nl "4.0.0~"; then
20 if perl -e '1' 2> /dev/null && rrdtool > /dev/null 2>&1; then
21 db_input high collectd/auto-migrate-3-4 || true
22 db_go || true
23 else
24 db_input high collectd/migration-3-4 || true
25 db_go || true
26 fi
27 fi
28 ;;
30 reconfigure)
31 ;;
33 *)
34 echo "config called with unknown argument \`$1'" >&2
35 exit 1
36 ;;
37 esac
39 db_stop
41 exit 0