feat: support openim readme docs

Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
pull/1866/head
Xinwei Xiong (cubxxw) 2 years ago
parent 3026b74e9c
commit f3cf608e3e

@ -360,11 +360,9 @@ openim::util::check_ports() {
# If any of the processes is not running, return a status of 1. # If any of the processes is not running, return a status of 1.
if [[ ${#not_started[@]} -ne 0 ]]; then if [[ ${#not_started[@]} -ne 0 ]]; then
echo "" openim::color::echo $COLOR_RED " OpenIM Stdout Log >> cat ${LOG_FILE}"
echo "!!! OpenIM Stdout Log >> cat ${LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}"
echo "!!! OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}" cat "$TMP_LOG_FILE" | awk '{print "\033[31m" $0 "\033[0m"}'
echo ""
cat "$TMP_LOG_FILE"
return 1 return 1
else else
openim::log::success "All specified processes are running." openim::log::success "All specified processes are running."
@ -448,10 +446,9 @@ openim::util::check_process_names() {
# Return status # Return status
if [[ ${#not_started[@]} -ne 0 ]]; then if [[ ${#not_started[@]} -ne 0 ]]; then
echo "++++ OpenIM Log >> cat ${LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stdout Log >> cat ${LOG_FILE}"
echo "!!! OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}"
echo "" cat "$TMP_LOG_FILE" | awk '{print "\033[31m" $0 "\033[0m"}'
cat "$TMP_LOG_FILE"
return 1 return 1
else else
openim::log::success "All processes are running." openim::log::success "All processes are running."
@ -1543,12 +1540,12 @@ openim::util::check_ports() {
if [[ "$OSTYPE" == "linux-gnu"* ]]; then if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if command -v ss > /dev/null 2>&1; then if command -v ss > /dev/null 2>&1; then
info=$(ss -ltnp | grep ":$port" || true) info=$(ss -ltnp | grep ":$port" || true)
echo "!!!!!!!!!!! port=$port" openim::color::echo $COLOR_RED "!!!!!!!! port=$port"
echo "!!!!!!!!!!! info=$info" openim::color::echo $COLOR_RED "!!!!!!!! info=$info"
else else
info=$(netstat -ltnp | grep ":$port" || true) info=$(netstat -ltnp | grep ":$port" || true)
echo "!!!!!!!!!!! port=$port" openim::color::echo $COLOR_RED "!!!!!!!! port=$port"
echo "!!!!!!!!!!! info=$info" openim::color::echo $COLOR_RED "!!!!!!!! info=$info"
fi fi
elif [[ "$OSTYPE" == "darwin"* ]]; then elif [[ "$OSTYPE" == "darwin"* ]]; then
# For macOS, use lsof # For macOS, use lsof
@ -1601,10 +1598,10 @@ openim::util::check_ports() {
# If any of the processes is not running, return a status of 1. # If any of the processes is not running, return a status of 1.
if [[ ${#not_started[@]} -ne 0 ]]; then if [[ ${#not_started[@]} -ne 0 ]]; then
echo "++++ OpenIM Log >> cat ${LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stdout Log >> cat ${LOG_FILE}"
echo "!!! OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}"
echo "" echo ""
cat "$TMP_LOG_FILE" cat "$TMP_LOG_FILE" | awk '{print "\033[31m" $0 "\033[0m"}'
return 1 return 1
else else
openim::log::success "All specified processes are running." openim::log::success "All specified processes are running."
@ -1688,10 +1685,9 @@ openim::util::check_process_names() {
# Return status # Return status
if [[ ${#not_started[@]} -ne 0 ]]; then if [[ ${#not_started[@]} -ne 0 ]]; then
echo "++++ OpenIM Log >> cat ${LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stdout Log >> cat ${LOG_FILE}"
echo "!!! OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}" openim::color::echo $COLOR_RED " OpenIM Stderr Log >> cat ${STDERR_LOG_FILE}"
echo "" cat "$TMP_LOG_FILE" | awk '{print "\033[31m" $0 "\033[0m"}'
cat "$TMP_LOG_FILE"
return 1 return 1
else else
openim::log::success "All processes are running." openim::log::success "All processes are running."

Loading…
Cancel
Save