__checking_depends_package() {
# CentOS 检查并安装 bc
# 这里安装命令循环了 3 次, 如果装不成功, 会重新尝试
if [[ "$(yum list installed bc | grep '^bc\.' -c)" != "1" ]]; then
yum install -y bc
if [[ "${_count}" == "" ]]; then _count=0; else ((_count++)); fi
if ((_count <= 3)); then
__checking_depends_package
else
echo "bc 安装失败"
exit
fi
fi
}
__checking_depends_package