Ubuntu Pastebin

Paste from menno at Wed, 1 Jul 2015 03:25:05 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
function setreplconfig() {
{
cat <<EOF
cfg=rs.config()
cfg.members[0]["priority"] = $1
rs.reconfig(cfg)
EOF
} | mongo --quiet 127.0.0.1:37017/juju --ssl --username "admin" --password "`sudo grep oldpassword ~/.juju/local/agents/machine-0/agent.conf  | cut -d' ' -f2`" --authenticationDatabase admin
}

while true; do
      setreplconfig 0.9
      setreplconfig 0.1
      sleep 1
done
Download as text