Make the lighttpd enable/disable a bit more automatic.

This commit is contained in:
Oliver Jowett 2016-07-10 12:00:46 +01:00
parent ebfa6f63be
commit 9012b46ee1
3 changed files with 30 additions and 4 deletions

View file

@ -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

View file

@ -26,7 +26,16 @@ case "$1" in
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)
;;
*)

View file

@ -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