mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
Script Refactoring
This commit is contained in:
parent
1d245a1d26
commit
d417645d48
@ -56,10 +56,8 @@ check_binaries_stop() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ "$running_binaries" -ne 0 ]; then
|
if [ "$running_binaries" -ne 0 ]; then
|
||||||
echo "There are $running_binaries binaries still running. Aborting..."
|
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
echo "All processes have been stopped."
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@ -284,6 +284,11 @@ function openim::log::print_red() {
|
|||||||
echo -e "[$current_time] \033[0;31m$1\033[0m"
|
echo -e "[$current_time] \033[0;31m$1\033[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openim::log::print_red_two_lines() {
|
||||||
|
local current_time=$(date "+%Y-%m-%d %H:%M:%S %Z")
|
||||||
|
echo -e "[$current_time]"
|
||||||
|
echo -e "\033[0;31m$1\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,11 +14,10 @@ kill_exist_binaries
|
|||||||
|
|
||||||
result=$(check_binaries_stop)
|
result=$(check_binaries_stop)
|
||||||
ret_val=$?
|
ret_val=$?
|
||||||
|
|
||||||
if [ $ret_val -ne 0 ]; then
|
if [ $ret_val -ne 0 ]; then
|
||||||
echo "$result"
|
openim::log::print_red "Some services have not been stopped, details are as follows:"
|
||||||
echo "no stop..."
|
openim::log::print_red_two_lines "$result"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "all stop"
|
openim::log::print_green "All services have been stopped"
|
||||||
Loading…
x
Reference in New Issue
Block a user