mirror of
https://github.com/d0zingcat/deploy.git
synced 2026-05-25 07:26:45 +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)
|
GMT_OFFSET=$(date +%z)
|
||||||
|
|
||||||
# Check available open port for Gateway
|
# Check available open port for Gateway
|
||||||
PORT=15888
|
GATEWAY_PORT=15888
|
||||||
LIMIT=$((PORT+1000))
|
LIMIT=$((GATEWAY_PORT+1000))
|
||||||
while [[ $PORT -le LIMIT ]]
|
while [[ $GATEWAY_PORT -le LIMIT ]]
|
||||||
do
|
do
|
||||||
if [[ $(netstat -nat | grep "$PORT") ]]; then
|
if [[ $(netstat -nat | grep "$GATEWAY_PORT") ]]; then
|
||||||
# check another port
|
# 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
|
else
|
||||||
break
|
break
|
||||||
fi
|
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 conf path:" "$CONF_FOLDER"
|
||||||
printf "%30s %5s\n" "Gateway log path:" "$LOGS_FOLDER"
|
printf "%30s %5s\n" "Gateway log path:" "$LOGS_FOLDER"
|
||||||
printf "%30s %5s\n" "Gateway certs path:" "$CERTS_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
|
echo
|
||||||
|
|
||||||
prompt_existing_certs_path () {
|
prompt_existing_certs_path () {
|
||||||
@@ -140,7 +154,8 @@ create_instance () {
|
|||||||
# Launch a new instance of gateway
|
# Launch a new instance of gateway
|
||||||
docker run \
|
docker run \
|
||||||
--name $INSTANCE_NAME \
|
--name $INSTANCE_NAME \
|
||||||
-p $PORT:$PORT \
|
-p $GATEWAY_PORT:15888 \
|
||||||
|
-p $DOCS_PORT:8080 \
|
||||||
-v $CONF_FOLDER:/usr/src/app/conf \
|
-v $CONF_FOLDER:/usr/src/app/conf \
|
||||||
-v $LOGS_FOLDER:/usr/src/app/logs \
|
-v $LOGS_FOLDER:/usr/src/app/logs \
|
||||||
-v $CERTS_FOLDER:/usr/src/app/certs \
|
-v $CERTS_FOLDER:/usr/src/app/certs \
|
||||||
@@ -152,6 +167,6 @@ if [[ "$PROCEED" == "Y" || "$PROCEED" == "y" ]]
|
|||||||
then
|
then
|
||||||
create_instance
|
create_instance
|
||||||
else
|
else
|
||||||
echo " Aborted"
|
echo "Aborted"
|
||||||
echo
|
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