Skip to content

Commit

Permalink
Remove surplus white-spaces.
Browse files Browse the repository at this point in the history
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
  • Loading branch information
kwilczynski committed Oct 31, 2011
1 parent 2ae2927 commit 7e392fa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/automongobackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,18 +335,18 @@ function select_secondary_member {
# Return list of with all replica set members
members=( $(mongo --quiet --eval \
'rs.conf().members.forEach(function(x){ print(x.host) })') )

# Check each replset member to see if it's a secondary and return it.
if [ ${#members[@]} -gt 1 ] ; then
for member in "${members[@]}" ; do

is_secondary=$(mongo --quiet --host $member --eval 'rs.isMaster().secondary')
case "$is_secondary" in
'true')
# First secondary wins ...
secondary=$member
break
;;
;;
'false')
# Skip particular member if it is a Primary.
continue
Expand All @@ -358,7 +358,7 @@ function select_secondary_member {
esac
done
fi

if [ -n "$secondary" ] ; then
# Ugly hack to return value from a Bash function ...
eval $__return="'$secondary'"
Expand Down

0 comments on commit 7e392fa

Please sign in to comment.