?? delay.in
字號(hào):
#!/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 $?
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -