From 5718b9697a2d645a979d4495b590822cebf325dc Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 11 Sep 2020 09:09:50 +0200 Subject: [PATCH] maybe fix some stuff in script, sorry for cutting history --- tar1090.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tar1090.sh b/tar1090.sh index b3f8497..a7880e8 100755 --- a/tar1090.sh +++ b/tar1090.sh @@ -61,7 +61,7 @@ if (( ${#chunksAll} < ${#chunks} )); then fi new_chunk() { - if [[ $1 != "refresh" ]]; then + if [[ "$1" != "refresh" ]]; then cur_chunk="chunk_$(date +%s%N | head -c-7).gz" echo "$cur_chunk" >> chunk_list echo "$cur_chunk" >> chunk_list_all @@ -109,8 +109,6 @@ elif .tisb != null and (.tisb | contains(["lat"])) then "tisb" else .type end), while true do cd "$RUN_DIR" || { sleep 30; continue; } - echo "{ \"files\" : [ ] }" | gzip -1 > empty.gz - new_chunk empty.gz if ! [ -f "$SRC_DIR/aircraft.json" ]; then echo "No aircraft.json found in $SRC_DIR! Try restarting dump1090!" sleep 180 @@ -118,10 +116,11 @@ do fi rm -f chunk_list chunk_list_all ./chunk_*.gz ./current_*.gz history_*.json latest_*.json || true + echo "{ \"files\" : [ ] }" | gzip -1 > empty.gz + new_chunk empty.gz + cp empty.gz current_small.gz cp empty.gz current_large.gz - touch chunk_list - touch chunk_list_all # integrate original dump1090-fa history on startup so we don't start blank if [[ -f "$SRC_DIR"/history_0.json ]]; then