2015-08-06 10:21:56 +00:00
|
|
|
#!/bin/sh
|
2017-04-21 11:59:28 +00:00
|
|
|
# $Id: testminissdpd.sh,v 1.8 2017/04/21 11:57:59 nanard Exp $
|
|
|
|
# (c) 2017 Thomas Bernard
|
2015-08-06 10:21:56 +00:00
|
|
|
|
2015-09-04 16:24:39 +00:00
|
|
|
OS=`uname -s`
|
2015-08-06 10:21:56 +00:00
|
|
|
IF=lo
|
2017-04-21 11:59:28 +00:00
|
|
|
if [ "$OS" = "Darwin" ] || [ "$OS" = "OpenBSD" ] || [ "$OS" = "SunOS" ] || [ "$OS" = "FreeBSD" ] ; then
|
2015-09-04 16:24:39 +00:00
|
|
|
IF=lo0
|
|
|
|
fi
|
2016-01-13 10:11:47 +00:00
|
|
|
# if set, 1st argument is network interface
|
|
|
|
if [ -n "$1" ] ; then
|
|
|
|
IF=$1
|
|
|
|
fi
|
2015-09-04 16:35:16 +00:00
|
|
|
SOCKET=`mktemp -t minissdpdsocketXXXXXX`
|
2015-08-06 10:21:56 +00:00
|
|
|
PID="${SOCKET}.pid"
|
|
|
|
./minissdpd -s $SOCKET -p $PID -i $IF || exit 1
|
|
|
|
./testminissdpd -s $SOCKET || exit 2
|
|
|
|
kill `cat $PID`
|