From abd144ebe9ebfc38b388335e1bf2aa9d7a634018 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Fri, 16 Oct 2020 19:37:44 +0200 Subject: [PATCH] also disable mlat-client service if pointed at adsbexchange.com --- setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 2c25b27..d159dbe 100755 --- a/setup.sh +++ b/setup.sh @@ -358,13 +358,18 @@ EOF sed -i -e "/$name/d" /etc/rc.local >> $LOGFILE 2>&1 fi PID="$(pgrep -f "$name" 2>/dev/null)" - PIDS="$PID $(pgrep -P $PID 2>/dev/null)" if [ ! -z "$PID" ]; then + PIDS="$PID $(pgrep -P $PID 2>/dev/null)" echo killing: $PIDS >> $LOGFILE 2>&1 kill -9 $PIDS >> $LOGFILE 2>&1 fi done + # in case the mlat-client service using /etc/default/mlat-client as config is using adsbexchange as a host, disable the service + if grep -qs 'SERVER_HOSTPORT.*feed.adsbexchange.com' /etc/default/mlat-client &>/dev/null; then + systemctl disable --now mlat-client >> $LOGFILE 2>&1 + fi + echo 94 sleep 0.25