mirror of
https://github.com/d0zingcat/deploy.git
synced 2026-05-14 15:09:44 +00:00
(feat) improve gateway script
This commit is contained in:
0
bash_scripts/gateway-copy-certs.sh
Normal file → Executable file
0
bash_scripts/gateway-copy-certs.sh
Normal file → Executable file
33
bash_scripts/gateway-create.sh
Normal file → Executable file
33
bash_scripts/gateway-create.sh
Normal file → Executable file
@@ -57,13 +57,26 @@ prompt_passphrase
|
||||
GMT_OFFSET=$(date +%z)
|
||||
|
||||
# Check available open port for Gateway
|
||||
PORT=15888
|
||||
LIMIT=$((PORT+1000))
|
||||
while [[ $PORT -le LIMIT ]]
|
||||
GATEWAY_PORT=15888
|
||||
LIMIT=$((GATEWAY_PORT+1000))
|
||||
while [[ $GATEWAY_PORT -le LIMIT ]]
|
||||
do
|
||||
if [[ $(netstat -nat | grep "$PORT") ]]; then
|
||||
if [[ $(netstat -nat | grep "$GATEWAY_PORT") ]]; then
|
||||
# check another port
|
||||
((PORT = PORT + 1))
|
||||
((GATEWAY_PORT = GATEWAY_PORT + 1))
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Check available open port for Gateway docs
|
||||
DOCS_PORT=8080
|
||||
LIMIT=$((DOCS_PORT+1000))
|
||||
while [[ $DOCS_PORT -le LIMIT ]]
|
||||
do
|
||||
if [[ $(netstat -nat | grep "$DOCS_PORT") ]]; then
|
||||
# check another port
|
||||
((DOCS_PORT = DOCS_PORT + 1))
|
||||
else
|
||||
break
|
||||
fi
|
||||
@@ -80,7 +93,8 @@ printf "%30s %5s\n" "Hummingbot instance ID:" "$HUMMINGBOT_INSTANCE_ID"
|
||||
printf "%30s %5s\n" "Gateway conf path:" "$CONF_FOLDER"
|
||||
printf "%30s %5s\n" "Gateway log path:" "$LOGS_FOLDER"
|
||||
printf "%30s %5s\n" "Gateway certs path:" "$CERTS_FOLDER"
|
||||
printf "%30s %5s\n" "Gateway port:" "$PORT"
|
||||
printf "%30s %5s\n" "Gateway port:" "$GATEWAY_PORT"
|
||||
printf "%30s %5s\n" "Gateway docs port:" "$DOCS_PORT"
|
||||
echo
|
||||
|
||||
prompt_existing_certs_path () {
|
||||
@@ -140,7 +154,8 @@ create_instance () {
|
||||
# Launch a new instance of gateway
|
||||
docker run \
|
||||
--name $INSTANCE_NAME \
|
||||
-p $PORT:$PORT \
|
||||
-p $GATEWAY_PORT:15888 \
|
||||
-p $DOCS_PORT:8080 \
|
||||
-v $CONF_FOLDER:/usr/src/app/conf \
|
||||
-v $LOGS_FOLDER:/usr/src/app/logs \
|
||||
-v $CERTS_FOLDER:/usr/src/app/certs \
|
||||
@@ -152,6 +167,6 @@ if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
||||
then
|
||||
create_instance
|
||||
else
|
||||
echo " Aborted"
|
||||
echo "Aborted"
|
||||
echo
|
||||
fi
|
||||
fi
|
||||
0
bash_scripts/hummingbot-create.sh
Normal file → Executable file
0
bash_scripts/hummingbot-create.sh
Normal file → Executable file
0
bash_scripts/hummingbot-start.sh
Normal file → Executable file
0
bash_scripts/hummingbot-start.sh
Normal file → Executable file
0
bash_scripts/hummingbot-update.sh
Normal file → Executable file
0
bash_scripts/hummingbot-update.sh
Normal file → Executable file
Reference in New Issue
Block a user