Skip to content

Commit

Permalink
Update start.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
shawaj authored Nov 19, 2024
1 parent 7208db1 commit 5a10af2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions wingbits/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ echo " "

# Check if Wingbits is latest version

local_version=$(cat /etc/wingbits/version)
WINGBITS_PATH="/etc/wingbits"
local_version=$(cat $WINGBITS_PATH/version)
echo "Current local version: $local_version"

SCRIPT_URL="https://gitlab.com/wingbits/config/-/raw/master/download.sh"
SCRIPT_URL="https://install.wingbits.com/download.sh"
script=$(curl $SCRIPT_URL)
version=$(echo "$script" | grep -oP '(?<=WINGBITS_CONFIG_VERSION=")[^"]*')
echo "Latest available wingbits version: $version"
rm -rf download.sh

if [ "$version" != "$local_version" ] || [ -z "$version" ]; then
echo "WARNING: You are not running the latest Wingbits version. Please update at your earliest convenience."
Expand All @@ -58,9 +60,12 @@ echo " "

# Variables are verified – continue with startup procedure.

# Place correct station ID in config.json
sed -i -e "s/STATION_ID/$WINGBITS_DEVICE_ID/" $WINGBITS_PATH/config.json

# Start vector and readsb and put in the background.
/usr/bin/vector --watch-config &
/usr/bin/feed-wingbits --net --net-only --debug=n --quiet --net-connector localhost,30006,json_out --write-json /run/wingbits-feed --net-beast-reduce-interval 0.5 --net-heartbeat 60 --net-ro-size 1280 --net-ro-interval 0.2 --net-ro-port 0 --net-sbs-port 0 --net-bi-port 30154 --net-bo-port 0 --net-ri-port 0 --net-connector "$RECEIVER_HOST","$RECEIVER_PORT",beast_in 2>&1 | stdbuf -o0 sed --unbuffered '/^$/d' | awk -W interactive '{print "[readsb-wingbits] " $0}' &
/etc/wingbits/wingbits feeder start 2>&1 | stdbuf -o0 sed --unbuffered '/^$/d' | awk -W interactive '{print "[wingbits-feeder] " $0}' &

# Wait for any services to exit.
wait -n

0 comments on commit 5a10af2

Please sign in to comment.