Skip to content

Commit 5ddb6c2

Browse files
committed
Fix entrypoint commands
1 parent 9ba2cb9 commit 5ddb6c2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -euo pipefail
23

34
### generate pgpass file
@@ -31,8 +32,8 @@ then
3132

3233

3334
DB_MAX_BLOCK=$(psql -h $PGHOST $PGDATABASE -U $PGUSER -t -c 'select max (block_no) from block;')
34-
NODE_CUR_BLOCK=0
35-
while [ $NODE_CUR_BLOCK -lt $DB_MAX_BLOCK ]; do
35+
NODE_CUR_BLOCK="0"
36+
while [ "$NODE_CUR_BLOCK" -lt "$DB_MAX_BLOCK" ]; do
3637
NODE_STATUS="$(cardano-cli query tip --mainnet 2>/dev/null || true)"
3738
NODE_CUR_BLOCK="$(jq -e -r '.block' <<<"$NODE_STATUS" 2>/dev/null || true)"
3839
echo "Waiting... Sync progress at $NODE_CUR_BLOCK /$DB_MAX_BLOCK"
@@ -54,7 +55,7 @@ CONFIG_HOME="/environments"
5455
if [ -z "${NETWORK:-}" ]; then
5556
echo "NETWORK is not set, defaulting to mainnet"
5657
NETWORK="mainnet"
57-
NO_NETWORK_SET=1
58+
NO_NETWORK_SET="1"
5859
else
5960
echo "NETWORK is set to $NETWORK"
6061
fi
@@ -76,7 +77,7 @@ fi
7677
if [[ -z "${DB_SYNC_CONFIG:-}" ]]; then
7778
DB_SYNC_CONFIG="$CONFIG_HOME/$NETWORK"
7879

79-
elif [[ -z "${NO_NETWORK_SET}" ]]; then # dbsync config is set and network is not
80+
elif [[ -z "${NO_NETWORK_SET:-}" ]]; then # dbsync config is set and network is not
8081
DB_SYNC_CONFIG="$CONFIG_HOME"
8182

8283
else ## both NETWORK and DB_SYNC_CONFIG are set

0 commit comments

Comments
 (0)