2 # postinst script for munin-cn
4 # see: dh_installdeb(1)
8 # summary of how this script can be called:
9 # * <postinst> `configure' <most-recently-configured-version>
10 # * <old-postinst> `abort-upgrade' <new version>
11 # * <conflictor's-postinst> `abort-remove' `in-favour' <package>
13 # * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
14 # <failed-install-package> <version> `removing'
15 # <conflicting-package> <version>
16 # for details, see http://www.debian.org/doc/debian-policy/ or
17 # the debian-policy package
21 configure|reconfigure)
31 . /usr/share/carnet-tools/functions.sh
34 CARNET_HOSTNAME=`hostname`
35 CARNET_DOMAINNAME=`hostname --domain`
37 # fix the hostname in munin/munin-node configuration
38 cp_check_and_sed 'localhost.localdomain' \
39 "s/localhost.localdomain/$CARNET_HOSTNAME.$CARNET_DOMAINNAME/g" \
40 /etc/munin/munin.conf || true
41 cp_check_and_sed 'localhost.localdomain' \
42 "s/localhost.localdomain/$CARNET_HOSTNAME.$CARNET_DOMAINNAME/g" \
43 /etc/munin/munin-node.conf || true
45 # restart the services
46 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
47 invoke-rc.d munin-node restart || exit $?
49 service munin-node restart || exit $?
52 # dh_installdeb will replace this with shell code automatically
53 # generated by other debhelper scripts.