Skip to content

Commit 8e842cd

Browse files
committed
Merge pull request #3667 from gavinandresen/rpctest_osxcompat
Make qa/rpc-tests/ compatible with OSX
2 parents 6056c87 + 867dfb4 commit 8e842cd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

qa/rpc-tests/send.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
#!/bin/bash
22
TIMEOUT=10
33
SIGNAL=HUP
4+
PIDFILE=.send.pid
45
if [ $# -eq 0 ]; then
56
echo -e "Usage:\t$0 <cmd>"
67
echo -e "\tRuns <cmd> and wait ${TIMEOUT} seconds or until SIG${SIGNAL} is received."
78
echo -e "\tReturns: 0 if SIG${SIGNAL} is received, 1 otherwise."
9+
echo -e "Or:\t$0 -STOP"
10+
echo -e "\tsends SIG${SIGNAL} to running send.sh"
811
exit 0
912
fi
13+
14+
if [ $1 == "-STOP" ]; then
15+
if [ -s ${PIDFILE} ]; then
16+
kill -s ${SIGNAL} $(<${PIDFILE})
17+
fi
18+
exit 0
19+
fi
20+
1021
trap '[[ ${PID} ]] && kill ${PID}' ${SIGNAL}
22+
trap 'rm -f ${PIDFILE}' EXIT
23+
echo $$ > ${PIDFILE}
1124
"$@"
1225
sleep ${TIMEOUT} & PID=$!
1326
wait ${PID} && exit 1
27+
1428
exit 0

qa/rpc-tests/util.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function CreateDataDir {
2323
echo "rpcuser=rt" >> $CONF
2424
echo "rpcpassword=rt" >> $CONF
2525
echo "rpcwait=1" >> $CONF
26-
echo "walletnotify=killall -HUP `basename ${SENDANDWAIT}`" >> $CONF
26+
echo "walletnotify=${SENDANDWAIT} -STOP" >> $CONF
2727
shift
2828
while (( "$#" )); do
2929
echo $1 >> $CONF

0 commit comments

Comments
 (0)