mirror of
https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git
synced 2024-11-25 15:20:10 +00:00
adsbx stats: more robust way of getting UUID from ultrafeeder_config
This commit is contained in:
parent
0a894ed3d7
commit
ec6f092418
1 changed files with 6 additions and 1 deletions
|
@ -34,7 +34,12 @@ fi
|
||||||
|
|
||||||
# set the UUID:
|
# set the UUID:
|
||||||
if [[ ! -f /usr/local/share/adsbexchange/adsbx-uuid ]]; then
|
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:-${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
|
ADSBX_UUID="${ADSBX_UUID:-$(cat /proc/sys/kernel/random/uuid 2>/dev/null)}" || true # ...else generate a random one
|
||||||
if [[ -n "$ADSBX_UUID" ]]; then
|
if [[ -n "$ADSBX_UUID" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue