15.2.1_介绍函数式动画
2011-12-12 20:33
85 查看
#!/bin/bash
#chkconfig:35 99 99
#description: Monitor the usage of disk
proc="diskmond"
# test parameters syntax
if [ $# -eq 0 ]
then
echo "参数不正确 例:diskmond [start,restart,stop,status]"
exit 1
fi
function start()
{
if [ -e /var/run/$proc.pid ]
then
echo "磁盘监控程序已经在运行(pid `cat /var/run/$proc.pid`)"
else
echo "磁盘监控程序正在启动中...."
./etc/rc.d/init.d/diskmon &
if [ $? -eq 0 ]
then
pidof -s -x diskmond >/var/run/diskmond.pid
echo "磁盘监控程序启动成功(pid `cat /var/run/$proc.pid`)~"
else
echo "磁盘监控程序发生未知错误,启动失败!"
exit 1
fi
fi
}
function stop()
{
if [ -e /var/run/$proc.pid ]
then
echo "正在停止磁盘监控程序...."
kill -9 `cat /var/run/"$proc".pid`
if [ $? -eq 0 ]
then
echo "磁盘监控程序已经停止"
else
echo "磁盘监控程序停止发生错误(失败)."
fi
rm -f /var/run/$proc.pid
else
echo "磁盘监控程序没有开启"
fi
function status()
{
if [ -e /var/run/$proc.pid ]
then
echo "磁盘监控程序(pid `cat /var/run/${proc}.pid`)正在运行"
else
echo "磁盘监控程序没有开启"
fi
}
function restart()
{
stop
start
}
case $1 in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo "参数不正确 例:diskmond [start,restart,stop,status]"
exit 1
;;
esac
本文出自 “天雪泪” 博客,请务必保留此出处http://hongjun.blog.51cto.com/445761/390731
#chkconfig:35 99 99
#description: Monitor the usage of disk
proc="diskmond"
# test parameters syntax
if [ $# -eq 0 ]
then
echo "参数不正确 例:diskmond [start,restart,stop,status]"
exit 1
fi
function start()
{
if [ -e /var/run/$proc.pid ]
then
echo "磁盘监控程序已经在运行(pid `cat /var/run/$proc.pid`)"
else
echo "磁盘监控程序正在启动中...."
./etc/rc.d/init.d/diskmon &
if [ $? -eq 0 ]
then
pidof -s -x diskmond >/var/run/diskmond.pid
echo "磁盘监控程序启动成功(pid `cat /var/run/$proc.pid`)~"
else
echo "磁盘监控程序发生未知错误,启动失败!"
exit 1
fi
fi
}
function stop()
{
if [ -e /var/run/$proc.pid ]
then
echo "正在停止磁盘监控程序...."
kill -9 `cat /var/run/"$proc".pid`
if [ $? -eq 0 ]
then
echo "磁盘监控程序已经停止"
else
echo "磁盘监控程序停止发生错误(失败)."
fi
rm -f /var/run/$proc.pid
else
echo "磁盘监控程序没有开启"
fi
function status()
{
if [ -e /var/run/$proc.pid ]
then
echo "磁盘监控程序(pid `cat /var/run/${proc}.pid`)正在运行"
else
echo "磁盘监控程序没有开启"
fi
}
function restart()
{
stop
start
}
case $1 in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
restart
;;
*)
echo "参数不正确 例:diskmond [start,restart,stop,status]"
exit 1
;;
esac
本文出自 “天雪泪” 博客,请务必保留此出处http://hongjun.blog.51cto.com/445761/390731
相关文章推荐
- 15.2.1_介绍函数式动画
- 15.2.1 介绍函数式动画
- animate.css动画库使用方法介绍
- jQuery动画animate方法使用介绍
- HTML5之SVG 2D入门11―用户交互性(动画)介绍及应用
- Tween动画属性介绍
- 转场动画相关方法介绍
- IOS UIKit框架类之视图动画和坐标系介绍!
- Android动画之旅一Android动画基本介绍
- Css3 3d animation Step1---介绍如何实现css动画
- CSS 3动画介绍
- 【iOS开发-9】UIImage和UIImageView属性介绍,实现图片动画,实现开始/停止按钮效果
- [Cocos2d-x开发问题-3] cocos2dx动画Animation介绍
- Android中Animation动画的介绍及用法
- jQuery中的属性操作,jQuery中的事件处理、jQuery 中的动画简单介绍
- iOS动画简单使用及介绍
- Anidrod-View Animation动画介绍
- 【Android】两种动画介绍(Tween动画、Frame动画)
- 【Android 基础】Animation 动画介绍和实现
- [置顶] 我的Android进阶之旅------>介绍一款集录制与剪辑为一体的屏幕GIF 动画制作工具 GifCam