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