Another try at script server fix
This commit is contained in:
parent
0c5d197295
commit
51a02409c8
1 changed files with 4 additions and 3 deletions
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue