1
0
Fork 0
mirror of https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git synced 2024-10-16 05:50:44 +00:00

adsbx stats: more robust way of getting UUID from ultrafeeder_config

This commit is contained in:
Matthias Wirth 2024-03-29 15:01:45 +01:00
parent 0a894ed3d7
commit ec6f092418

View file

@ -34,7 +34,12 @@ fi
# set the UUID:
if [[ ! -f /usr/local/share/adsbexchange/adsbx-uuid ]]; then
ADSBX_UUID="$(sed 's|.*adsbexchange.*uuid=\([a-f0-9-]\+\).*|\1|g' <<< "${READSB_CONF_ARR[@]}")" || true # get UUID from ULTRAFEEDER_CONFIG if it exists
# get UUID from ULTRAFEEDER_CONFIG if it exists
for entry in "${READSB_CONF_ARR[@]}"; do
if echo "$entry" | grep -q 'adsbexchange.*uuid'; then
ADSBX_UUID="$(sed 's|.*adsbexchange.*uuid=\([a-f0-9-]\+\).*|\1|g' <<< "$entry")"
fi
done
ADSBX_UUID="${ADSBX_UUID:-${UUID}}" || true # ...else get it from the UUID param
ADSBX_UUID="${ADSBX_UUID:-$(cat /proc/sys/kernel/random/uuid 2>/dev/null)}" || true # ...else generate a random one
if [[ -n "$ADSBX_UUID" ]]; then