#!/bin/sh # postinst script for munin-cn # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # case "$1" in configure|reconfigure) # continue below ;; *) exit 0 ;; esac # import CN-functions . /usr/share/carnet-tools/functions.sh # variables CARNET_HOSTNAME=`hostname` CARNET_DOMAINNAME=`hostname --domain` # fix the hostname in munin/munin-node configuration cp_check_and_sed 'localhost.localdomain' \ "s/localhost.localdomain/$CARNET_HOSTNAME.$CARNET_DOMAINNAME/g" \ /etc/munin/munin.conf || true cp_check_and_sed 'localhost.localdomain' \ "s/localhost.localdomain/$CARNET_HOSTNAME.$CARNET_DOMAINNAME/g" \ /etc/munin/munin-node.conf || true # restart the services if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d munin-node restart || exit $? else /etc/init.d/munin-node restart || exit $? fi # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0