(feat) improve gateway script

This commit is contained in:
cardosofede
2023-03-03 14:29:49 -03:00
parent af525628d7
commit 1dd2dcc2a3
5 changed files with 24 additions and 9 deletions

0
bash_scripts/gateway-copy-certs.sh Normal file → Executable file
View File

33
bash_scripts/gateway-create.sh Normal file → Executable file
View 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
View File

0
bash_scripts/hummingbot-start.sh Normal file → Executable file
View File

0
bash_scripts/hummingbot-update.sh Normal file → Executable file
View File