Commit 8067cdb6 authored by QM's avatar QM

updata

parent 036203b0
FROM ubuntu:16.04.02 FROM ubuntu:16.04
WORKDIR /root WORKDIR /root
COPY relayer.toml relayer.toml COPY relayer.toml relayer.toml
......
...@@ -71,6 +71,7 @@ function InitAndDeploy() { ...@@ -71,6 +71,7 @@ function InitAndDeploy() {
} }
function port_exist() { function port_exist() {
local prot_ori=${portRelayer}
grep_port=$(netstat -tlpn | grep "\b${portRelayer}\b") grep_port=$(netstat -tlpn | grep "\b${portRelayer}\b")
while [ -n "$grep_port" ]; do while [ -n "$grep_port" ]; do
echo "port $portRelayer is in use" echo "port $portRelayer is in use"
...@@ -78,9 +79,8 @@ function port_exist() { ...@@ -78,9 +79,8 @@ function port_exist() {
grep_port=$(netstat -tlpn | grep "\b${portRelayer}\b") grep_port=$(netstat -tlpn | grep "\b${portRelayer}\b")
done done
if [ "${portRelayer}" != "20000" ]; then if [ "${portRelayer}" != "${prot_ori}" ]; then
line=$(delete_line_show "./docker-compose-ebrelayer.yml" "20000:20000") sed -i 's/'"${prot_ori}"'/'"${portRelayer}"'/g' "./docker-compose-ebrelayer.yml"
sed -i ''"${line}"' a \ \ \ \ \ \ -\ "'${portRelayer}':'${portRelayer}'"' "./docker-compose-ebrelayer.yml"
fi fi
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment