diff --git a/Dockerfile b/Dockerfile index 3ddf31a..385f6ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,8 +63,6 @@ RUN \ rm /etc/nginx/sites-enabled/default && \ # tar1090: install using project copy of original script bash /app/rootfs/tar1090-install.sh /run/readsb webroot "${TAR1090_INSTALL_DIR}" && \ - # change some /run/tar1090-webroot to /run/readsb to make work with existing docker scripting - sed -i -e 's#/run/tar1090-webroot/#/run/readsb/#' /usr/local/share/tar1090/nginx-tar1090-webroot.conf && \ # tar1090-db: document version echo "tar1090-db $(cat ${TAR1090_UPDATE_DIR}/git-db/version)" >> VERSIONS && \ # tar1090: document version diff --git a/rootfs/etc/s6-overlay/s6-rc.d/tar1090/finish b/rootfs/etc/s6-overlay/s6-rc.d/tar1090/finish new file mode 100644 index 0000000..dd201e0 --- /dev/null +++ b/rootfs/etc/s6-overlay/s6-rc.d/tar1090/finish @@ -0,0 +1,2 @@ +#!/bin/sh +rm -rf /run/tar1090 diff --git a/rootfs/etc/s6-overlay/scripts/tar1090 b/rootfs/etc/s6-overlay/scripts/tar1090 index 8fca336..d6915da 100755 --- a/rootfs/etc/s6-overlay/scripts/tar1090 +++ b/rootfs/etc/s6-overlay/scripts/tar1090 @@ -7,17 +7,17 @@ if chk_enabled "${TAR1090_DISABLE}"; then stop_service fi -mkdir -p /run/tar1090 +rundir="/run/tar1090" +mkdir -p "$rundir" sleep 5 # shellcheck source=/dev/null #source "${TAR1090_INSTALL_DIR}/default" srcdir=/run/readsb -service=readsb exec s6wrap --quiet --prepend=tar1090 --timestamps --args bash /usr/local/share/tar1090/tar1090.sh \ - "/run/$service" \ + "$rundir" \ "$srcdir" # "$INTERVAL" \ diff --git a/rootfs/etc/s6-overlay/startup.d/04-tar1090-configure b/rootfs/etc/s6-overlay/startup.d/04-tar1090-configure index 7e1211f..901bbf3 100755 --- a/rootfs/etc/s6-overlay/startup.d/04-tar1090-configure +++ b/rootfs/etc/s6-overlay/startup.d/04-tar1090-configure @@ -32,10 +32,11 @@ else fi # Add in CORS header for tar1090 data/aircraft.json file +# adjust the tar1090 runtime directory to /run/tar1090 sed -i \ -e 's/location ~ aircraft\\.json$ {/location ~ aircraft\.json$ {\n add_header Access-Control-Allow-Origin "\*";/g' \ - -e 's#/run/tar1090-webroot/#/run/readsb/#' \ + -e 's#/run/tar1090-webroot/#/run/tar1090/#' \ "${TAR1090_INSTALL_DIR}/nginx-tar1090-webroot.conf"