Script Refactoring

pull/2148/head
skiffer-git 2 years ago
parent 1d245a1d26
commit d417645d48

@ -56,10 +56,8 @@ check_binaries_stop() {
done
if [ "$running_binaries" -ne 0 ]; then
echo "There are $running_binaries binaries still running. Aborting..."
return 1
else
echo "All processes have been stopped."
return 0
fi
}

@ -284,6 +284,11 @@ function openim::log::print_red() {
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)
ret_val=$?
if [ $ret_val -ne 0 ]; then
echo "$result"
echo "no stop..."
openim::log::print_red "Some services have not been stopped, details are as follows:"
openim::log::print_red_two_lines "$result"
exit 1
fi
echo "all stop"
openim::log::print_green "All services have been stopped"
Loading…
Cancel
Save