another small bit of script changes

This commit is contained in:
Matthias Wirth
2020-09-13 09:08:24 +02:00
parent ad4da25054
commit 1febfe05fe
2 changed files with 7 additions and 13 deletions

View File

@@ -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=""

View File

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