Skip to content

Instantly share code, notes, and snippets.

@washingtonsoares
Created December 22, 2017 19:56
Show Gist options
  • Save washingtonsoares/b4112ab0c808f285732b9c9085f28375 to your computer and use it in GitHub Desktop.
Save washingtonsoares/b4112ab0c808f285732b9c9085f28375 to your computer and use it in GitHub Desktop.
#!/bin/bash
serverAmount=$1
initialThriftPort=$2
initialCopyCatPort=$3
for ((number=0; number < $serverAmount; number++)){
port=$((initialThriftPort+number))
mvn exec:java -Dexec.mainClass=chavevalor.ChaveValorServer -Dexec.args="$port $number $serverAmount $initialThriftPort" &
}
for ((number=0; number < $serverAmount*3; number+=3)){
port1=$((initialCopyCatPort))
port2=$((initialCopyCatPort+1))
port3=$((initialCopyCatPort+2))
mvn exec:java -Dexec.mainClass=chavevalor.MapStateMachine -Dexec.args="$number localhost $port1 localhost $port2 localhost $port3" &
}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment