improve testminissdpdnotif.sh script

This commit is contained in:
Thomas Bernard 2016-01-18 00:19:50 +01:00
parent fd4b4049e7
commit 3dfbeccee9
1 changed files with 9 additions and 1 deletions

View File

@ -11,8 +11,16 @@ fi
if [ -n "$1" ] ; then
IF=$1
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
./showminissdpdnotif -s $SOCKET || exit 2
sleep .5
echo "minissdpd process id `cat $PID`"
./showminissdpdnotif -s $SOCKET
echo "showminissdpdnotif returned $?"
kill `cat $PID`