From 72f2d41f0c5b7c7d19153e0fe8b4712fab6e4cfd Mon Sep 17 00:00:00 2001 From: Jeff Deaton Date: Sat, 19 Oct 2019 13:22:59 -0600 Subject: [PATCH] Create the json output directory if it doesn't exist --- debian/dump1090-fa.postinst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/dump1090-fa.postinst b/debian/dump1090-fa.postinst index d2698ef..89fc579 100644 --- a/debian/dump1090-fa.postinst +++ b/debian/dump1090-fa.postinst @@ -36,6 +36,10 @@ case "$1" in # Make sure the "data" directory is owned by dump1090 so the dump1090-fa process has write access jsondir="/usr/share/dump1090-fa/html/data" + if [ ! -d ${jsondir} ]; then + echo "Creating directory ${jsondir}..." >&2 + mkdir ${jsondir} + fi if [ -d ${jsondir} ]; then echo "Changing permissions on ${jsondir}..." >&2 chown ${RUNAS}:nogroup ${jsondir} @@ -90,7 +94,6 @@ case "$1" in echo "Starting the dump1090-fa service..." >&2 systemctl restart dump1090-fa - ;; abort-upgrade|abort-remove|abort-deconfigure)