脚本样例:
#!/bin/bash
#
# author: chenxuyi
# createtime: 2015/09/21
# description: example for init
#
# chkconfig: 2345 95 5
# processname: test
# 函数定义
start(){}
stop(){}
restart(){}
# 程序主体
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
restart
;;
*)
echo "Use method: start | stop | reload"
exit 1
esac
exit 2上面所列出的都是自启动脚本必需要有的(对本人而言,实际情况并非如此)

本文提供了一个bash脚本示例,用于演示如何创建一个简单的自启动脚本,其中包括了脚本的基本结构、函数定义及使用方法。
1004

被折叠的 条评论
为什么被折叠?



