sh wait-for-bosh-lock.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh wait-for-bosh-lock.sh相关的知识,希望对你有一定的参考价值。

wait_lock() {
  local deployment="$1"; shift
  local timeout=$(($(date +%s) + ${1:-120})) # by default timeout is 120 secs
  local iteration=0

  bosh locks &>/dev/null | grep $deployment

  while ([ $? == 1 ] && [ $(date +%s) -lt $timeout ]) ; do
    sleep 10
    ((iteration++))
    echo "Waiting for a lock on $deployment deployment for $(echo $iteration)0 seconds"
    bosh locks &>/dev/null | grep $deployment
  done

  bosh locks &>/dev/null | grep $deployment
  if [ $? == 1 ] ; then
    echo "Timeout error: can't wait lock for $deployment deployment (timeout is ${1:-120} seconds)"
  fi
}

以上是关于sh wait-for-bosh-lock.sh的主要内容,如果未能解决你的问题,请参考以下文章

如何使我的命令行在具有扩展名(.sh)和名称如“weird.sh.sh.sh”的文件上工作

sh sh_template.sh

sh sh.sh

Linux下面如何运行 SH文件

配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh

shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别