Skip to content

Commit cbb5e69

Browse files
refactor: print more logs in start-all.sh.
1 parent b41b054 commit cbb5e69

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

installer/start-all.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,34 @@ set -e
44

55
if [ -f "/opt/maxkb/PG_VERSION" ]; then
66
# 如果是v1版本一键安装的的目录则退出
7-
echo "FATAL ERROR: Upgrade from v1 to v2 is not supported."
8-
echo "The process will exit."
7+
echo -e "\033[1;31mFATAL ERROR: Upgrade from v1 to v2 is not supported.\033[0m"
8+
echo -e "\033[1;31mThe process will exit.\033[0m"
99
exit 1
1010
fi
1111

1212
if [ "$MAXKB_DB_HOST" = "127.0.0.1" ]; then
13-
echo "PostgreSQL starting..."
13+
echo -e "\033[1;32mPostgreSQL starting...\033[0m"
1414
/usr/bin/start-postgres.sh &
1515
postgres_pid=$!
16-
sleep 10
17-
wait-for-it 127.0.0.1:5432 --timeout=120 --strict -- echo "PostgreSQL started."
16+
sleep 5
17+
wait-for-it 127.0.0.1:5432 --timeout=120 --strict -- echo -e "\033[1;32mPostgreSQL started.\033[0m"
1818
fi
1919

2020
if [ "$MAXKB_REDIS_HOST" = "127.0.0.1" ]; then
21-
echo "Redis starting..."
21+
echo -e "\033[1;32mRedis starting...\033[0m"
2222
/usr/bin/start-redis.sh &
2323
redis_pid=$!
2424
sleep 5
25-
wait-for-it 127.0.0.1:6379 --timeout=60 --strict -- echo "Redis started."
25+
wait-for-it 127.0.0.1:6379 --timeout=60 --strict -- echo -e "\033[1;32mRedis started.\033[0m"
2626
fi
2727

28+
echo -e "\033[1;32mMaxKB starting...\033[0m"
2829
/usr/bin/start-maxkb.sh &
2930
maxkb_pid=$!
31+
sleep 10
32+
wait-for-it 127.0.0.1:8080 --timeout=60 --strict -- echo -e "\033[1;32mMaxKB started.\033[0m"
3033

3134
wait -n
35+
echo -e "\033[1;31mSystem is shutting down.\033[0m"
3236
kill $postgres_pid $redis_pid $maxkb_pid 2>/dev/null
3337
wait

0 commit comments

Comments
 (0)