delay.in

来自「linux集群服务器软件代码包」· IN 代码 · 共 90 行

IN
90
字号
#!/bin/sh##	$Id: Delay.in,v 1.2 2005/01/12 03:13:34 horms Exp $##	This script is a test resource for introducing delay.##	usage: $0  {start|stop|status|monitor}#	usage: $0  delay {start|stop|status|monitor}#	usage: $0  startdelay stopdelay {start|stop|status|monitor}##	This is really a test resource script.#usage() {  cat <<-!	usage: $0 [delay [stopdelay]] {start|stop|status|monitor}";  	$Id: Delay.in,v 1.2 2005/01/12 03:13:34 horms Exp $	!  exit 1}. @sysconfdir@/ha.d/shellfuncsVARLIB=@localstatedir@/lib/@HB_PKG@VLFILE=$VARLIB/rsctmp/DelayDelay_stat() {    test -f $VLFILE}Delay_Status() {  if    Delay_stat  then    echo "Delay is running OK"    exit 0  else    echo "Delay is not operational"    exit 1  fi}Delay_Start() {  if    Delay_stat  then    echo "Delay already running"    return 0  else    touch $VLFILE    rc=$?    sleep $StartDelay    return $rc  fi}Delay_Stop() {  if    Delay_stat  then    unlink $VLFILE    rc=$?    sleep $StopDelay    return $rc  else    echo "Delay already stopped"    return 0  fi}case $# in  1)	StartDelay=30; StopDelay=30; op=$1;;  2)	StartDelay=$1; StopDelay=$1; op=$2;;  3)	StartDelay=$1; StopDelay=$2; op=$3;;  *)	usage; exit 1;;esaccase $op in  start)		Delay_Start;;  stop)			Delay_Stop;;  status|monitor)	Delay_Status;;  *)			usage 			exit 1;;esacexit $?

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?