代码拉取完成,页面将自动刷新
#!/bin/bash
Mnexeenvcheck()
{
. ${scriptsdir}/lib/sysf/os_cmd.fun
cmdschk=''
if [[ $OS_TYPE = "LINUX" ]];then
cmdschk='df
vmstat
ifconfig
sed
'
elif [[ $OS_TYPE = "AIX" ]];then
if [[ $(oslevel |awk -F '.' '{print $1}') -eq 6 ]];then
echo "OS Check OK!"
else
echo "OS CHeck failed."
exit 1
fi
cmdschk='prtconf
df
vmstat
ifconfig
sed
'
elif [[ $OS_TYPE = "HP" ]];then
if [[ $(uname -r|grep 'B.11'|wc -l) -eq 1 ]];then
echo "OS Check OK!"
else
echo "OS CHeck failed."
exit 1
fi
cmdschk='bdf
vmstat
ifconfig
sed
machinfo
'
else
echo "OS CHeck failed."
exit 1
fi
for cmdstr in $cmdschk
do
(which $cmdstr)>/dev/null 2>&1
if [[ $? -gt 0 ]];then
echo "CMD Check failed,$cmdstr is not exists."
exit 1
fi
done
echo "CMD Check OK!"
}
Mnstart()
{
sh ${scriptsdir}/bin/Mn.sh start
}
Mnstop()
{
sh ${scriptsdir}/bin/Mn.sh stop
}
Mnstatus()
{
sh ${scriptsdir}/bin/Mn.sh status
}
Mnrestart()
{
sh ${scriptsdir}/bin/Mn.sh restart
}
Mnmkcnf()
{
sh ${scriptsdir}/bin/Mn.sh mkcnf
}
Mn100log()
{
tail -100 ${scriptsdir}/alertmn.log
}
##########main###########################
scriptsdir=$(cd `dirname $0`; pwd)
. ${scriptsdir}/conf/mn.cnf
scriptsdir=$(cd `dirname $0`; pwd)
. ${scriptsdir}/lib/sysf/mn.fun
mnbanner
if [[ $1 = "restart" ]];then
echo "Mn restart."
Mnrestart
exit 1
fi
echo "Now mn version:mn.v01.02.20150327"
PS3="Please input your choice:"
A="Mn start:Mn stop:Mn status:Mn restart:Mn mkcnf:Mn alertlog:exit" && IFS=:
select i in ${A};do
case $i in
"Mn start")
echo "Mn start."
Mnstart
;;
"Mn stop")
echo "Mn stop."
Mnstop
;;
"Mn status")
echo "Mn status."
Mnstatus
;;
"Mn restart")
echo "Mn restart."
Mnrestart
;;
"Mn mkcnf")
echo "Mn mkcnf."
Mnmkcnf
;;
"Mn alertlog")
echo "Mn alertlog."
Mn100log
;;
exit)
exit 0 ;;
*)
echo "Not the right choice!";
;;
esac
done
exit 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。