From 4d3e79281d11a7e8b5402c9997531af7ed1ed3d2 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 1 Dec 2021 11:57:43 +0800 Subject: [PATCH] script --- script/docker_check_service.sh | 7 +++++++ script/env_check.sh | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 script/env_check.sh diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh index afb1022b3..c65d38d7f 100644 --- a/script/docker_check_service.sh +++ b/script/docker_check_service.sh @@ -1,3 +1,10 @@ #!/usr/bin/env bash +echo "docker-compose ps....................." docker-compose ps + +sleep 10 + +echo "check OpenIM.........................." ./check_all.sh + + diff --git a/script/env_check.sh b/script/env_check.sh new file mode 100644 index 000000000..6af30a37b --- /dev/null +++ b/script/env_check.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +source ./style_info.cfg +echo -e "check environment......................................." + +SYSTEM=`uname -s` +if [ $SYSTEM != "Linux" ] ; then + echo -e ${RED_PREFIX}"Warning: Currently only Linux is supported"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "Linux system is ok"${COLOR_SUFFIX} +fi + +echo -e "check memory............................................" +available=`free -m | grep Mem | awk '{print $NF}'` +if [ $available -lt 2000 ] ; then + echo -e ${RED_PREFIX}"Warning: Your memory not enough, available is: " "$available"m${COLOR_SUFFIX}"\c" + echo -e ${RED_PREFIX}", must be greater than 2000m"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "Memory is ok, available is: "$available"m${COLOR_SUFFIX}" +fi +