-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.sh
35 lines (23 loc) · 819 Bytes
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
# This script launches the actual experiment.
# This script will contact the seeder nodes to let them start seeding
# and contact the peerflix nodes to start playing
DOWNLOAD_PATH=/vagrant
TORRENT=${DOWNLOAD_PATH}/movie.torrent
if [[ "$*" != "skip-init" ]]; then
## VAGRANT
vagrant up --provision --parallel
## SEEDERS
echo ">> Starting Deluge daemon..."
vagrant ssh seeder-1 -c "deluged"
# We have to wait for deluge to set everything up...
sleep 5
echo ">> Disabling DHT..."
vagrant ssh seeder-1 -c "deluge-console \"config -s dht False\""
echo ">> Giving the torrent to deluge..."
vagrant ssh seeder-1 -c "deluge-console \"add -p ${DOWNLOAD_PATH} ${TORRENT}\""
fi
## PEERFLIX
for i in {1..9}; do
vagrant ssh peerflix-${i} -c "bash /vagrant/measurements/run.sh ${TORRENT} &" &
done