Use Python instead of Perl.

This commit is contained in:
David Glasser
2013-01-02 17:18:35 -08:00
parent 8231783d22
commit f3940cab78

View File

@@ -125,11 +125,11 @@ sleep 2 # need to make sure these kills take effect
echo "... mongo message"
# Use perl to listen on a port, so that Mongo fails to start up. (We used to use
# nc here, but the way you specify listener ports to nc varies between
# Use Python to listen on a port, so that Mongo fails to start up. (We used to
# use nc here, but the way you specify listener ports to nc varies between
# platforms. Bleah.)
perl -MIO::Socket::INET -e '$a = IO::Socket::INET->new(LocalPort=>('$PORT' + 2),LocalAddr=>"127.0.0.1",Proto=>"tcp",ReuseAddr=>1,Listen=>5) or die; sleep' &
PERL_PID=$!
python -c 'from socket import *; s = socket(); s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1); s.bind(("127.0.0.1", '$PORT'+2)); s.listen(1); s.accept()' &
PYTHON_PID=$!
sleep 1
@@ -137,7 +137,7 @@ $METEOR -p $PORT > error.txt || true
grep 'port was closed' error.txt > /dev/null
kill -9 $PERL_PID > /dev/null
kill -9 $PYTHON_PID > /dev/null
echo "... settings"