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