X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;fp=debian%2Fpostinst;h=e5edbbb0eb0e060b4c73664ec354bcd4e56a21d4;hb=5212d51fc40173b98d63228a20a10fb8b1610dde;hp=e665ab67e597c3266aeb1760cb18f3382482deb8;hpb=a000c6ad70156b8fb5fce7a9e584ddfe902e318a;p=monit-cn.git diff --git a/debian/postinst b/debian/postinst index e665ab6..e5edbbb 100755 --- a/debian/postinst +++ b/debian/postinst @@ -47,6 +47,15 @@ if [ $installfile -eq 1 ]; then chmod u=rw,go= /etc/monit/monitrc fi +# sed monitrc with proper hostname +if grep -q '@localhost' /etc/monit/monitrc; then + CARNET_HOSTNAME=`hostname` + CARNET_DOMAINNAME=`hostname --domain` + cp_check_and_sed '@localhost' \ + "s/@localhost/@$CARNET_HOSTNAME.$CARNET_DOMAINNAME/g" \ + /etc/monit/monitrc || true +fi + # (re)generate monit.d files update-monit.d || true