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:
parent
c03cbdd73b
commit
04e7707600
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||||
|
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 $!
|
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} &
|
||||||
|
|
Loading…
Reference in a new issue