当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 6

网络工作室/ollnmp
暂停

forked from Arjun/ollnmp
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
log.sh 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
18818701315@163.COM 提交于 2019-04-13 01:41 . 提交初始化代码
#!/bin/bash
Color_Text()
{
echo -e " \e[0;$2m$1\e[0m"
}
Echo_Red()
{
echo $(Color_Text "$1" "31")
}
Echo_Green()
{
echo $(Color_Text "$1" "32")
}
Echo_Yellow()
{
echo $(Color_Text "$1" "33")
}
Echo_Blue()
{
echo $(Color_Text "$1" "34")
}
writeLog(){
mType=\>
mEmpty=" "
SERVICE_FILE=${source_dir}/log/install.log
echo `date`${mEmpty}${mType}${mEmpty}$1 >> ${SERVICE_FILE}
}
checkRedis(){
myredis=`ps -ef|grep redis|grep -v grep|grep -v 'su'|grep -v tail |grep -v vi|grep -v admin.sh|awk '{print $2}'`
if [ "${myredis}" != "" ];then
echo -e "\033[32m Redis is running \033[0m"
else
echo -e "\033[31m Redis is false \033[0m"
fi
}
checkPhp(){
myphp=`ps -ef|grep php-fpm|grep -v grep|grep -v 'su'|grep -v tail |grep -v vi|grep -v admin.sh|awk '{print $2}'`
if [ "${myphp}" != "" ];then
echo -e "\033[32m php is running \033[0m"
else
echo -e "\033[31m php is false \033[0m"
fi
}
checkMysql(){
mysqld=`ps -ef|grep mysqld|grep -v grep|grep -v 'su'|grep -v tail |grep -v vi|grep -v admin.sh|awk '{print $2}'`
if [ "${mysqld}" != "" ];then
echo -e "\033[32m mysql is running \033[0m"
else
echo -e "\033[31m mysql is false \033[0m"
fi
}
checkNginx(){
mynginx=`ps -ef|grep /usr/local/nginx/sbin/nginx|grep -v grep|grep -v 'su'|grep -v tail |grep -v vi|grep -v admin.sh|awk '{print $2}'`
if [ "${mynginx}" != "" ];then
echo -e "\033[32m nginx is running \033[0m"
else
echo -e "\033[31m nginx is false \033[0m"
fi
}
checkService(){
checkRedis
checkPhp
checkMysql
checkNginx
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/jf12458/ollnmp.git
git@gitee.com:jf12458/ollnmp.git
jf12458
ollnmp
ollnmp
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385