Skip to content

Commit

Permalink
add redis rdb loading check.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkgo committed Aug 28, 2024
1 parent adcc657 commit a8da2e6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,15 @@ redis-server /tmp/redis.conf
if ! ps -ef | grep -v grep | grep -q redis-server; then
redis-server /tmp/redis.conf --ignore-warnings ARM64-COW-BUG
fi
while ! redis-cli -s /tmp/redis.sock info | grep -q human; do
echo "Waiting for redis..."
sleep 1
while true; do
loading=$(redis-cli -s /tmp/redis.sock info | grep loading | grep -oE "[0-9]" | tr -d '\n')
if [ "$loading" = "00" ]; then
echo "Redis rdb has finished loading."
break
else
echo "Waiting for Redis rdb to load..."
sleep 1
fi
done
sed "s/{CORES}/$CORES/g" /data/unbound.conf | sed "s/{POWCORES}/$POWCORES/g" | sed "s/{FDLIM}/$FDLIM/g" | sed "s/{MEM1}/$MEM1/g" | sed "s/{MEM2}/$MEM2/g" | sed "s/{MEM3}/$MEM3/g" | sed "s/{ETHIP}/$ETHIP/g" | sed "s/{DNS_SERVERNAME}/$DNS_SERVERNAME/g" >/tmp/unbound.conf
# if [ "$DEVLOG" = "yes" ]; then
Expand Down

0 comments on commit a8da2e6

Please sign in to comment.