Skip to content

Commit ab87651

Browse files
committed
update initmudbjson.sh
1 parent e21f017 commit ab87651

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

initmudbjson.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ ip_count=`echo $ip_addr|grep -e "^[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+$" -c`
77
if [[ $ip_count == 1 ]]; then
88
echo "server IP is "${ip_addr}
99
sed -i 's/SERVER_PUB_ADDR = .\+/SERVER_PUB_ADDR = '${ip_addr}'/g' userapiconfig.py
10-
port=`python -c 'import random;print(random.randint(10000, 65536))'`
11-
python mujson_mgr.py -a -p ${port}
10+
user_count=`python mujson_mgr.py -l|grep -c ""`
11+
if [[ $user_count == 0 ]]; then
12+
port=`python -c 'import random;print(random.randint(10000, 65536))'`
13+
python mujson_mgr.py -a -p ${port}
14+
fi
1215
else
1316
echo "unable to detect server IP"
1417
fi

0 commit comments

Comments
 (0)