summaryrefslogtreecommitdiff
path: root/buildbot/switch.sh
blob: 048972706a97a27f12234256a0ae9add7559084a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

active=$(sudo -u test cat /home/test/active)
nonactive="test-blue"
echo "Active party: ${active}"

if test $active = "test-blue"; then
  nonactive="test-green"
fi

cmd=$(printf "%s; %s" \
  "cd /home/test" \
  "./deployment/bin/taler-deployment-switch-${nonactive}")

echo "Switching to ${nonactive}."
sudo -u test bash -c "${cmd}"