📄 delay.in
字号:
#!/bin/sh## $Id: Delay.in,v 1.2.2.1 2005/01/12 03:12: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.2.1 2005/01/12 03:12: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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -