#!/bin/bash
 
A=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' party0) 
B=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' party1) 
C=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' party2) 
echo $A
echo $B
echo $C
docker exec -w /root/duoram/duoram-online party2 ./p2 $A $B 15 128 128 128 10 &
sleep 2
echo "P2 launched"
docker exec -w /root/duoram/duoram-online party1 ./duoram1  $A $C 15 128 128 128 10 &
sleep 2
echo "P1 launched"
docker exec -w /root/duoram/duoram-online party0 ./duoram0  $B $C 15 128 128 128 10 &
echo "P0 launched"
wait
