Another try at script server fix

This commit is contained in:
Raphael 2010-10-13 15:18:27 -07:00
parent 0c5d197295
commit 51a02409c8

View file

@ -7,19 +7,20 @@
PORT=3000 PORT=3000
while getopts ":p:" OPTION while getopts ":p:" OPTION
do do
if OPTION='p' if [ $OPTION == 'p' ]
then then
PORT=$OPTARG PORT=$OPTARG
fi fi
done done
services=$( netstat -nl | grep '[^:]:'$PORT'[ \t]') services=$( netstat -nl | grep ":$PORT[ \t]")
test -n "$services" && { test -n "$services" && {
echo "Warning: something is already using port "$PORT echo "Warning: something is already using port "$PORT
echo " $services" echo " $services"
exit exit
} }
exit
# Check if Mongo is running # Check if Mongo is running