[hamradio-commits] [dump1090-mutability] 135/172: Make the lighttpd enable/disable a bit more automatic.
Matteo F. Vescovi
mfv at moszumanska.debian.org
Sun Jan 28 13:45:53 UTC 2018
This is an automated email from the git hooks/post-receive script.
mfv pushed a commit to branch master
in repository dump1090-mutability.
commit 9652306601ce83311bd6156648ef9ad076a74aba
Author: Oliver Jowett <oliver at mutability.co.uk>
Date: Sun Jul 10 12:00:46 2016 +0100
Make the lighttpd enable/disable a bit more automatic.
---
debian/dump1090-mutability.postinst | 8 ++++++++
debian/dump1090-mutability.postrm | 17 +++++++++++++----
debian/dump1090-mutability.templates | 11 ++++++++++-
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/debian/dump1090-mutability.postinst b/debian/dump1090-mutability.postinst
index 244679f..5038c52 100644
--- a/debian/dump1090-mutability.postinst
+++ b/debian/dump1090-mutability.postinst
@@ -116,6 +116,14 @@ case "$1" in
touch $RET
chown $RUNAS $RET
+ # enable lighttpd if needed
+ db_get $NAME/use-lighttpd
+ if [ "$RET" = "true" -a -x /usr/sbin/lighty-enable-mod ]
+ then
+ echo "Enabling lighttpd integration.." >&2
+ /usr/sbin/lighty-enable-mod dump1090 || true
+ fi
+
# this config file has changed a few times, restart lighttpd to make sure we
# have the latest version
if [ -e /etc/lighttpd/conf-enabled/89-dump1090.conf ]; then
diff --git a/debian/dump1090-mutability.postrm b/debian/dump1090-mutability.postrm
index f5405fa..6251a8f 100644
--- a/debian/dump1090-mutability.postrm
+++ b/debian/dump1090-mutability.postrm
@@ -24,10 +24,19 @@ case "$1" in
rm -f /etc/default/dump1090-mutability
rm -f /etc/cron.d/dump1090-mutability
rm -rf /var/cache/dump1090-mutability
- ;;
-
- remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
- ;;
+ ;;
+
+ remove)
+ if [ -e /etc/lighttpd/conf-enabled/89-dump1090.conf ]; then
+ echo "Disabling lighttpd integration.." >&2
+ lighty-disable-mod dump1090 || true
+ echo "Restarting lighttpd.." >&2
+ invoke-rc.d lighttpd restart || echo "Warning: lighttpd failed to restart." >&2
+ fi
+ ;;
+
+ upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
*)
echo "postrm called with unknown argument \`$1'" >&2
diff --git a/debian/dump1090-mutability.templates b/debian/dump1090-mutability.templates
index 19762d2..fc9929e 100644
--- a/debian/dump1090-mutability.templates
+++ b/debian/dump1090-mutability.templates
@@ -186,13 +186,22 @@ Description: Interval between logging stats, in seconds:
Type: string
Default: 3600
+Template: dump1090-mutability/use-lighttpd
+Description: Enable the lighttpd integration?
+ dump1090 can serve a virtual radar map via a separate webserver.
+ This package includes a configuration for lighttpd that does this.
+ To use that configuration, enable this option.
+Type: boolean
+Default: true
+
Template: dump1090-mutability/json-dir
Description: Directory to write JSON aircraft state to:
As this can be written frequently, you should select a location
that is not on a sdcard. The default path under /run is on tmpfs
and will not write to the sdcard.
.
- A blank path disables writing JSON state.
+ A blank path disables writing JSON state. This will also disable
+ the virtual radar map.
Type: string
Default: /run/dump1090-mutability
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090-mutability.git
More information about the pkg-hamradio-commits
mailing list