From d7a4419cc755d6dab65c83ed0b31352f05e06bdf Mon Sep 17 00:00:00 2001 From: Aaron Chen <462826@qq.com> Date: Thu, 22 Aug 2019 14:42:02 +0800 Subject: [PATCH] shell sample --- xdoc/sample/go.tpl | 21 --------------------- xdoc/sample/python.tpl | 18 ------------------ xdoc/sample/tc-01.sh | 28 ++++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 39 deletions(-) delete mode 100644 xdoc/sample/go.tpl delete mode 100644 xdoc/sample/python.tpl create mode 100755 xdoc/sample/tc-01.sh diff --git a/xdoc/sample/go.tpl b/xdoc/sample/go.tpl deleted file mode 100644 index 6953cf53..00000000 --- a/xdoc/sample/go.tpl +++ /dev/null @@ -1,21 +0,0 @@ -package main - -/* -<</dev/null | grep 'time=' | sed 's/.*time=\([.0-9]*\) ms/\1/g' | awk -F. '{print $1}'` + echo $tm + + if [[ $tm -gt $timeout ]] ; then // timeout + ((count = 1)) // break + fi + ((count = count - 1)) +done + +if [ ! -n "$tm" ]; then + echo 'Unknown' +elif [[ $tm -gt $timeout ]]; then + echo 'Timeout' +else + echo 'Work' +fi \ No newline at end of file -- GitLab