Skip to content

Commit

Permalink
Error:Confiquration file does notexist (#453)
Browse files Browse the repository at this point in the history
* Optimize the script

* Optimize the script

* Optimize the script

* Optimize the script

* delete wechat

* delete wechat

* delete wechat

* Remove the logs directory

* fix bug: Error:Confiquration file does notexist

* debug
  • Loading branch information
skiffer-git authored Mar 7, 2024
1 parent e21c252 commit 03023dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
18 changes: 12 additions & 6 deletions scripts/check-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
OPENIM_ROOT=$(dirname "${SCRIPTS_ROOT}")/..
source $SCRIPTS_ROOT/util.sh


logs_dir="$SCRIPTS_ROOT/../_output/logs"
DOCKER_LOG_FILE="$logs_dir/chat-docker.log"

if is_running_in_container; then
Expand All @@ -35,11 +37,11 @@ if [ "$1" == "--print-screen" ]; then
PRINT_SCREEN=1
fi

mkdir -p ${SCRIPTS_ROOT}/../logs
#mkdir -p ${SCRIPTS_ROOT}/../logs

if [ -z "$PRINT_SCREEN" ]; then
exec >> ${SCRIPTS_ROOT}/../logs/chat_$(date '+%Y%m%d').log 2>&1
fi
#if [ -z "$PRINT_SCREEN" ]; then
# exec >> ${SCRIPTS_ROOT}/../logs/chat_$(date '+%Y%m%d').log 2>&1
#fi

#Include shell font styles and some basic information
source $SCRIPTS_ROOT/style-info.sh
Expand All @@ -51,6 +53,7 @@ source $SCRIPTS_ROOT/util.sh
all_services_running=true
not_running_count=0 # Initialize a counter for not running services


for binary_path in "${binary_full_paths[@]}"; do
result=$(check_services_with_name "$binary_path")
if [ $? -ne 0 ]; then
Expand All @@ -59,14 +62,17 @@ for binary_path in "${binary_full_paths[@]}"; do
# Print the binary path in red for not running services
echo -e "\033[0;31mService not running: $binary_path\033[0m"
fi
exit 1
done

if $all_services_running; then
for binary_path in "${binary_full_paths[@]}"; do
echo -e "\033[0;32mService running: $binary_path\033[0m"
done

# Print "Startup successful" in green
echo -e "\033[0;32mAll chat services startup successful\033[0m"
else
# Print the number of services that are not running
echo -e "\033[0;31m$not_running_count chat service(s) are not running.\033[0m"
exit 1
fi
fi
2 changes: 2 additions & 0 deletions scripts/docker-start-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ logs_dir="$SCRIPTS_ROOT/../_output/logs"
DOCKER_LOG_FILE="$logs_dir/chat-docker.log"


${OPENIM_ROOT}/scripts/init-config.sh --skip

"${OPENIM_ROOT}"/scripts/start-all.sh
tail -f ${DOCKER_LOG_FILE}
2 changes: 1 addition & 1 deletion scripts/start-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if [ -f "$CONFIG_FILE" ]; then
else
echo ""
# The file does not exist
echo "Error: Configuration file does not exist."
echo "Error: Configuration file does not exist." $CONFIG_FILE
echo "+++ You need to execute 'make init' to generate the configuration file and then modify the configuration items."
echo ""
exit 1
Expand Down

0 comments on commit 03023dc

Please sign in to comment.