1
0
Fork 0
mirror of https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git synced 2024-11-23 22:30:09 +00:00

make GPS-related restarts faster

This commit is contained in:
kx1t 2024-05-24 11:14:33 -04:00 committed by Matthias Wirth
parent c03cbdd73b
commit 04e7707600

View file

@ -265,7 +265,10 @@ do
if ! kill -0 "${mlat_pid}" >/dev/null 2>&1 if ! kill -0 "${mlat_pid}" >/dev/null 2>&1
then then
# it exited - let's restart: # it exited - let's restart:
sleep "${RESTARTTIMER}" & wait $! if [[ ! -f /run/readsb/gpsd.json ]] || [[ "$(jq -r .lat /run/readsb/gpsd.json)" == "null" ]]; then
# only sleep for a bit if the restarts aren't caused by GPS movement:
sleep "${RESTARTTIMER}" & wait $!
fi
servername="$(awk '{print $4}' <<< "${pid_array[$mlat_pid]}")" servername="$(awk '{print $4}' <<< "${pid_array[$mlat_pid]}")"
servername="${servername%%:*}" servername="${servername%%:*}"
@ -287,6 +290,7 @@ do
#shellcheck disable=SC2069,SC2086 #shellcheck disable=SC2069,SC2086
if [[ "${LOGLEVEL}" == "verbose" ]]; then if [[ "${LOGLEVEL}" == "verbose" ]]; then
"${s6wrap[@]}" --prepend="$(basename "$0")][${servername}" --args echo "Restarting: ${execstring}"
"${s6wrap[@]}" --prepend="$(basename "$0")][${servername}" --args ${execstring} & "${s6wrap[@]}" --prepend="$(basename "$0")][${servername}" --args ${execstring} &
elif [[ "${LOGLEVEL}" == "error" ]]; then elif [[ "${LOGLEVEL}" == "error" ]]; then
"${s6wrap[@]}" --ignore=stdout --prepend="$(basename "$0")][${servername}" --args ${execstring} & "${s6wrap[@]}" --ignore=stdout --prepend="$(basename "$0")][${servername}" --args ${execstring} &