From 5ba613dd443a913504f3b658a15a84891def9edf Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 2 Apr 2017 12:32:29 +0100 Subject: [PATCH] Only enable lighttpd config once, not on every upgrade. --- debian/dump1090-fa.postinst | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/dump1090-fa.postinst b/debian/dump1090-fa.postinst index 5608149..8c58aa7 100644 --- a/debian/dump1090-fa.postinst +++ b/debian/dump1090-fa.postinst @@ -35,15 +35,18 @@ case "$1" in adduser "$RUNAS" plugdev # set up lighttpd - echo "Enabling lighttpd integration.." >&2 - lighty-enable-mod dump1090-fa || true - - # only enable the statcache config if there is nothing else around that already - # configures it, because lighttpd fails if it's configured twice - if ! grep -q -E '^\S*server.stat-cache-engine' /etc/lighttpd/conf-enabled/*.conf + if dpkg --compare-versions "$2" lt "3.1.0" then - echo "Enabling lighttpd integration (stat cache).." >&2 - lighty-enable-mod dump1090-fa-statcache || true + echo "Enabling lighttpd integration.." >&2 + lighty-enable-mod dump1090-fa || true + + # only enable the statcache config if there is nothing else around that already + # configures it, because lighttpd fails if it's configured twice + if ! grep -q -E '^\S*server.stat-cache-engine' /etc/lighttpd/conf-enabled/*.conf + then + echo "Enabling lighttpd integration (stat cache).." >&2 + lighty-enable-mod dump1090-fa-statcache || true + fi fi echo "Restarting lighttpd.." >&2