2019-10-30 21:44:29 +05:30
|
|
|
#!/bin/sh
|
2019-10-31 14:34:36 +05:30
|
|
|
set -ex
|
2019-10-30 21:44:29 +05:30
|
|
|
. ./test.rc
|
|
|
|
|
|
|
|
MSG="kilroy"
|
|
|
|
|
2019-10-31 14:39:46 +05:30
|
|
|
/sbin/ifconfig -a
|
|
|
|
|
2019-10-31 15:16:49 +05:30
|
|
|
tshark -Qni lo -w ${CAP} port ${PORT} &
|
|
|
|
#tcpdump -qlni lo -w ${CAP} port ${PORT} &
|
2019-10-30 21:44:29 +05:30
|
|
|
PID="$!"
|
2019-10-31 15:22:27 +05:30
|
|
|
sleep 1
|
2019-10-31 14:39:46 +05:30
|
|
|
ps fax |grep -A3 tshark
|
2019-10-30 21:44:29 +05:30
|
|
|
|
|
|
|
../src/logger -u ${SOCK} ${MSG}
|
|
|
|
|
2019-10-31 15:22:27 +05:30
|
|
|
sleep 1
|
2019-10-31 15:16:49 +05:30
|
|
|
kill -TERM ${PID}
|
2019-10-30 21:44:29 +05:30
|
|
|
wait ${PID}
|
|
|
|
|
|
|
|
tshark -d udp.port==${PORT},syslog -r ${CAP} | grep ${MSG}
|
|
|
|
rm ${CAP}
|
|
|
|
|