Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1068981
  • 博文数量: 186
  • 博客积分: 4939
  • 博客等级: 上校
  • 技术积分: 2075
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-08 17:15
文章分类

全部博文(186)

文章存档

2018年(1)

2017年(3)

2016年(11)

2015年(42)

2014年(21)

2013年(9)

2012年(18)

2011年(46)

2010年(35)

分类: Python/Ruby

2012-02-15 10:33:53

  1. return_yes=0
  2. return_reload=1
  3. return_no=2
  4. return_skip=3

  5. do_promote ( ) {
  6.   command=${1}
  7.   promote=${2:-$1}
  8.   echo ""
  9.   echo "${promote}: [y]es or [s]kip? or [r]epeat last step?" && echo "$command" && read x
  10.   case "${x}" in
  11.   y|Y)
  12.     eval "$command"
  13.     return ${return_yes}
  14.     ;;
  15.   r|R)
  16. #do nothing bu need to decrease "i" by 2 in the circle
  17.     return ${return_reload}
  18.     ;;
  19.   s|S)
  20. #nothing to do
  21.     return ${return_skip}
  22.     ;;
  23.   *)
  24.     return ${return_no}
  25.     ;;
  26.   esac
  27. }

  28.     echo ""
  29.     echo "major version: ${major_version}"
  30.     echo "svn revision: ${revision}"
  31.     echo -e "respond y as \"yes\"; s as \"skip\"; and r as \"reload\", any other inpute will lead to exit\n"

  32. do_step0 ( ) {
  33.     do_promote "date" "** Ready to go upgrading ads"
  34.     return $?
  35. }

  36. do_step1 ( ) {
  37.     do_promote "sudo -u eng /opt/freewheel/scripts/rsync_build.sh ads ${rsync_version}" "1.Syncing the builds from build server"
  38.     return $?
  39. }

  40. for ((i=0;i<10;i++)) do
  41.     do_step${i}
  42.     return_code=$?
  43.     [ $return_code -eq $return_no ] && exit $return_no
  44.     [ $return_code -eq $return_reload ] && i=$(($i-2))
  45. done
阅读(1269) | 评论(0) | 转发(0) |
0

上一篇:a spec file sample

下一篇:xen install VMs

给主人留下些什么吧!~~