I've got this command which displays packets received and sent on port 1700.
tcpdump -AUq port 1700
In the packet there is the string rxpk
, but most of the packets don't have it. When the output contains this string I want some script (which flashes a led) to run.
tcpdump -AUq port 1700 | awk '/rxpk/ { print | "/path/to/blink_led 18" }'
But it appears that it only matches the first time an rxpk
is found, subsequent occurences wont trigger the { ... }
-part
Anybody an idea why? Or even an other approach to run a script when rxpk
is received?
rxpk
is printed by tcpdump.