File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / miniupnpd / minissdpd / testminissdpdnotif.sh
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Wed Sep 27 11:25:11 2023 UTC (15 months ago) by misho
CVS tags: MAIN, HEAD
Initial revision

#!/bin/sh
# $Id: testminissdpdnotif.sh,v 1.1 2023/09/27 11:25:11 misho Exp $
# (c) 2019 Thomas Bernard

OS=`uname -s`

# if set, 1st argument is network interface
if [ -n "$1" ] ; then
	IF=$1
else
	case $OS in
		*BSD | Darwin | SunOS)
			IF=lo0
			;;
		*)
			IF=lo
			;;
	esac
fi

# trap sigint in the script so CTRL-C interrupts the running program,
# not the script
trap 'echo SIGINT' INT

SOCKET=`mktemp -t minissdpdsocketXXXXXX`
PID="${SOCKET}.pid"
./minissdpd -s $SOCKET -p $PID -i $IF  || exit 1
sleep .5
echo "minissdpd process id `cat $PID`"
./showminissdpdnotif -s $SOCKET
echo "showminissdpdnotif returned $?"
kill `cat $PID`

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>