Skip to content

Commit

Permalink
revised shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
ronniedada committed Jul 25, 2013
1 parent e7c8725 commit 2c5a532
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cookbooks/couchbase/recipes/setup-2.1.0.rb
Expand Up @@ -146,14 +146,14 @@
log("clustering - rs_tag private_ip res: #{private_ips}")
if private_ips.length >= 1

cmd = "sleep 30 && /opt/couchbase/bin/couchbase-cli server-add" +
add = "sleep 30 && /opt/couchbase/bin/couchbase-cli server-add" +
" -c #{private_ips[0]}" +
" -u #{username}" +
" -p #{password}" +
" --server-add=#{ip}" +
" --server-add-username=#{username}" +
" --server-add-password=#{password} 2>\&1"
cmd = "for i in {1..5}; do x=`$cmd`; if [ $x -eq 0 ]; then break; else echo 'retrying ...'$i; fi; done"
cmd = "for i in {1..5}; do x=\`#{add}\`; if [[ -z "$x" ]]; then break; else sleep 30 && echo 'retrying...'$i; fi; done"
begin
log("clustering - server-add cmd: #{cmd}")
execute "clustering - server-add cmd: #{cmd}" do
Expand Down

0 comments on commit 2c5a532

Please sign in to comment.