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
|
||||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue