Annotation of embedaddon/miniupnpd/minissdpd/testminissdpdnotif.sh, revision 1.1
1.1 ! misho 1: #!/bin/sh
! 2: # $Id: testminissdpdnotif.sh,v 1.4 2019/02/10 13:39:18 nanard Exp $
! 3: # (c) 2019 Thomas Bernard
! 4:
! 5: OS=`uname -s`
! 6:
! 7: # if set, 1st argument is network interface
! 8: if [ -n "$1" ] ; then
! 9: IF=$1
! 10: else
! 11: case $OS in
! 12: *BSD | Darwin | SunOS)
! 13: IF=lo0
! 14: ;;
! 15: *)
! 16: IF=lo
! 17: ;;
! 18: esac
! 19: fi
! 20:
! 21: # trap sigint in the script so CTRL-C interrupts the running program,
! 22: # not the script
! 23: trap 'echo SIGINT' INT
! 24:
! 25: SOCKET=`mktemp -t minissdpdsocketXXXXXX`
! 26: PID="${SOCKET}.pid"
! 27: ./minissdpd -s $SOCKET -p $PID -i $IF || exit 1
! 28: sleep .5
! 29: echo "minissdpd process id `cat $PID`"
! 30: ./showminissdpdnotif -s $SOCKET
! 31: echo "showminissdpdnotif returned $?"
! 32: kill `cat $PID`
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>