Shell framework,
#! /Bin/bash
# Note
# Note
# Environment variables:
PATH =/sbin:/bin:/usr/sbin
# Import function, similar to # include "*. h" in C Language"
./Etc/init. d/functions
# Retrieving configuration information is not required, as shown in figure
Test-f/etc/sysconfig/network &./etc/sysconfig/network
# Determine whether the user is a root user. If not, exit.
['Id-U' = 0] | exit 1
# Define local variables, such
Prog = "xinetd"
# Define shell functions, such
Stop (){
Echo-n $ "Stopping $ prog :"
Killproc $ prog
RETVAL =$?
Echo
Rm-f/var/lock/subsys/xinetd
Return $ RETVAL
}
# Main shell script framework, generally a case structure or loop structure
Case "$1" in
Start)
Start
;;
Stop)
Stop
;;
Status)
Status $ prog
;;
Restart)
Restart
;;
Reload)
Reload
;;
Condrestart)
Condrestart
;;
*)
Echo $ "Usage: $0 {start | stop | status | restart | condrestart | reload }"
RETVAL = 1
Esac
# Exit