#!/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}"