>>>>> "Peter" == Peter Hardy <[EMAIL PROTECTED]> writes:
Peter> #!/bin/sh
Peter> logread -f | \ awk '$0 ~ /DROPPED/ { system("echo 0x01 >
/proc/sys/diag"); system("echo 0x00 > /proc/sys/diag");
}'
That's evil. There's no need *ever* to do a system(echo..) from an
awk script.
Try:
logread -f | dd bs=1 | awk '
/DROPPED/ {
print 0x01 > "/proc/sys/diag"
fflush("/proc/sys/diag")
print 0x00 > "/proc/sys/diag"
fflush("/proc/sys/diag")
}'
That's not going to be ideal, because there will be buffering inside
the pipe.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html