X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=c6d3069de0bb65a746ec8a6c9b9dc97005fedc22;hb=91c8ce169413bcdda70ddf931333843604131eb3;hp=29a05cdff582cad64fcd441465591f8180090714;hpb=8d66bcdb842e472697e8cf56b4e0ef7d8031a860;p=monit-cn.git diff --git a/debian/postinst b/debian/postinst index 29a05cd..c6d3069 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,39 +1,17 @@ #!/bin/sh -# postinst script for monit-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 -# +[ "$1" = "configure" ] || exit 0 +[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx -case "$1" in - configure|reconfigure) - # continue below - ;; - - *) - exit 0 - ;; -esac - -# import CN-functions +# Load CARNET Tools . /usr/share/carnet-tools/functions.sh # check if monitrc is ours installfile=1 if [ -e /etc/monit/monitrc ]; then - if ! grep -q "CARNet package monit-cn" /etc/monit/monitrc; then + if ! grep -q "CARNET package monit-cn" /etc/monit/monitrc; then installfile=1 mv -f /etc/monit/monitrc /etc/monit/monitrc.dpkg-old else @@ -76,7 +54,7 @@ cp_check_and_sed '^START[[:space:]]*=[[:space:]]*no' \ 's/^START[[:space:]]*=.*/START=yes/g' /etc/default/monit || true # remove us from systemv monit script -if grep -q 'CARNet package monit-cn' /etc/init.d/monit; then +if grep -q 'CARNET package monit-cn' /etc/init.d/monit; then echo "CN: Removing monit workaround from /etc/init.d/monit -- systemd is in use" cp-update -r monit-cn /etc/init.d/monit chmod +x /etc/init.d/monit