[root@hunt1574 ~]# cat case.sh
- #!/bin/sh
- #
- # description:
- #
- # processname:
- #
- case "$1" in
- start)
- echo "start"
- ;;
- stop)
- echo "stop"
- ;;
- restart|reload)
- echo "stop..."
- echo "start"
- ;;
- status)
- echo "status"
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|status}"
- exit
- esac
[root@hunt1574 ~]# sh case.sh
Usage: case.sh {start|stop|restart|status}
[root@hunt1574 ~]# sh case.sh start
start
[root@hunt1574 ~]# sh case.sh status
status
[root@hunt1574 ~]# sh case.sh restart
stop...
start