Create the json output directory if it doesn't exist

This commit is contained in:
Jeff Deaton 2019-10-19 13:22:59 -06:00
parent e7db494b18
commit 2109b1d041
1 changed files with 4 additions and 1 deletions

View File

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