Refactor Kismet control logic in runtest.sh to only start/stop when listener is disabled

This commit is contained in:
Yaro Kasear 2025-05-02 14:20:10 -05:00
parent a3588f3540
commit 412a63f51d

View file

@ -86,10 +86,10 @@ sudo -v
while true; do sudo -n true; sleep 60; done 2>/dev/null &
SUDO_KEEPALIVE_PID=$!
log "Starting kismet..."
SECONDS=0
sudo systemctl start kismet
log "Kismet startup took $SECONDS seconds"
if [ "$LISTENER_ENABLED" -eq 0 ]; then
log "Starting kismet..."
sudo systemctl start kismet
fi
log "Saturating the capture..."
sleep "$LEAD_TIME"
@ -257,8 +257,11 @@ for ((COUNTER = 1; COUNTER <= NUM_TESTS; COUNTER++)); do
[[ "$COUNTER" -lt "$NUM_TESTS" ]] && log "Waiting $TIME_BETWEEN before next test..." && sleep "$TIME_BETWEEN"
done
log "Stopping kismet..."
sudo systemctl stop kismet
if [ "$LISTENER_ENABLED" -eq 0 ]; then
log "Stopping kismet..."
sudo systemctl stop kismetS
fi
if [ "$NO_ENRICH" -eq 0 ]; then
log "Enriching data..."