From 1febfe05fe78e1ccc0fc3bc93f39fb2825654f23 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 13 Sep 2020 09:08:24 +0200 Subject: [PATCH] another small bit of script changes --- default | 8 +------- tar1090.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/default b/default index 17b531e..1e476ab 100644 --- a/default +++ b/default @@ -20,15 +20,9 @@ PTRACKS=8 - - - - - -PF_ENABLE=0 - # no need to change the lines below CHUNK_SIZE=60 INT_978=1 +PF_ENABLE=1 PF_URL="http://127.0.0.1:30053/ajax/aircraft" COMPRESS_978="" diff --git a/tar1090.sh b/tar1090.sh index a7880e8..d79d9f4 100755 --- a/tar1090.sh +++ b/tar1090.sh @@ -227,19 +227,19 @@ fi sleep 10 -if [[ -n $PF_URL ]] && [[ "x$PF_ENABLE" != "x0" ]]; then - TMP="/tmp/tar1090-tmp.pf.json.$RANDOM$RANDOM" +if [[ -n "$PF_URL" ]] && [[ "x$PF_ENABLE" != "x0" ]]; then while true do sleep 10 & - if cd "$RUN_DIR" && wget -T 5 -q -O $TMP "$PF_URL" &>/dev/null; then - sed -i -e 's/"user_l[a-z]*":"[0-9,.,-]*",//g' $TMP - mv $TMP pf.json + TMP="$RUN_DIR/tar1090-tmp.pf.json.$RANDOM$RANDOM" + if cd "$RUN_DIR" && wget -T 5 -O "$TMP" "$PF_URL" &>/dev/null; then + sed -i -e 's/"user_l[a-z]*":"[0-9,.,-]*",//g' "$TMP" + mv "$TMP" pf.json if ! grep -qs -e pf_data chunks.json; then new_chunk refresh fi else - rm -f $TMP + rm -f "$TMP" sleep 120 fi wait