also disable mlat-client service if pointed at adsbexchange.com

This commit is contained in:
Matthias Wirth 2020-10-16 19:37:44 +02:00
commit abd144ebe9

View file

@ -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