2016-01-13 15:07:09 +00:00
|
|
|
#!/bin/sh
|
2019-02-10 15:11:16 +00:00
|
|
|
# $Id: testminissdpdnotif.sh,v 1.4 2019/02/10 13:39:18 nanard Exp $
|
|
|
|
# (c) 2019 Thomas Bernard
|
2016-01-13 15:07:09 +00:00
|
|
|
|
|
|
|
OS=`uname -s`
|
2018-05-08 13:59:15 +00:00
|
|
|
|
2016-01-13 15:07:09 +00:00
|
|
|
# if set, 1st argument is network interface
|
|
|
|
if [ -n "$1" ] ; then
|
|
|
|
IF=$1
|
2018-05-08 13:59:15 +00:00
|
|
|
else
|
|
|
|
case $OS in
|
|
|
|
*BSD | Darwin | SunOS)
|
|
|
|
IF=lo0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
IF=lo
|
|
|
|
;;
|
|
|
|
esac
|
2016-01-13 15:07:09 +00:00
|
|
|
fi
|
2016-01-17 23:19:50 +00:00
|
|
|
|
|
|
|
# trap sigint in the script so CTRL-C interrupts the running program,
|
|
|
|
# not the script
|
|
|
|
trap 'echo SIGINT' INT
|
|
|
|
|
2016-01-13 15:07:09 +00:00
|
|
|
SOCKET=`mktemp -t minissdpdsocketXXXXXX`
|
|
|
|
PID="${SOCKET}.pid"
|
|
|
|
./minissdpd -s $SOCKET -p $PID -i $IF || exit 1
|
2016-01-17 23:19:50 +00:00
|
|
|
sleep .5
|
|
|
|
echo "minissdpd process id `cat $PID`"
|
|
|
|
./showminissdpdnotif -s $SOCKET
|
|
|
|
echo "showminissdpdnotif returned $?"
|
2016-01-13 15:07:09 +00:00
|
|
|
kill `cat $PID`
|