获取当前文件所在的绝对路径
basepath=$(cd $(dirname $0); pwd)
读取并执行文件中的命令
该命令通常用命令“.”来替代
source ${basepath}/util.sh
检查当前用户
if [[ "$(id -un)" != "service" ]]; then
erroLog "current user is invalid!"
exit 1
fi
查看某进程是否在运行
count=$(ps -wef | grep "mysql" | grep -v grep | wc -l)
if [[ count -ne 0 ]]; then
infoLog "Process is starting!"
exit 0
fi