通用Linux SysV start/stop 脚本
#!/bin/bash # chkconfig: 2345 96 14 # description: shell init script for Linux. # created by nowsafe . /etc/init.d/functions source /etc/bashrc source /etc/profile start() { 命令1 } stop() { 命令2 } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; version) exec 命令三 $1 ;; *) echo $"Usage: $0 {start|stop|restart|version}" exit 1 esac
转载于:https://blog.51cto.com/nowsafe/1391246