forked from UNIC-IFF/KNOB-BBF-Web-Application
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.sh
More file actions
executable file
·50 lines (32 loc) · 1.37 KB
/
Copy pathinitialize.sh
File metadata and controls
executable file
·50 lines (32 loc) · 1.37 KB
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
36
37
38
39
40
41
42
43
44
#!/bin/bash
DEFAULT_ENVFILE="$(dirname $0)/defaults.env"
ENVFILE=${ENVFILE:-"$DEFAULT_ENVFILE"}
source $ENVFILE
docker-compose up -d --build
if [ -d "$WORKING_DIR/blockchain-benchmarking-framework" ]
then
echo "Directory $WORKING_DIR/blockchain-benchmarking-framework exists."
echo "Requesting any updates..."
if [ -z "$(ls -A $WORKING_DIR/blockchain-benchmarking-framework )" ]; then
git clone "https://github.com/UNIC-IFF/blockchain-benchmarking-framework.git"
git -C $WORKING_DIR/blockchain-benchmarking-framework submodule update --init --recursive
else
git -C $WORKING_DIR/blockchain-benchmarking-framework submodule update
fi
else
echo "Error: Directory $WORKING_DIR/blockchain-benchmarking-framework does not exists."
git clone "https://github.com/UNIC-IFF/blockchain-benchmarking-framework.git"
git -C $WORKING_DIR/blockchain-benchmarking-framework submodule update --init --recursive
fi
echo "Creating pipe if not exist"
pipe=bbf-commands
if [[ ! -p "$WORKING_DIR/blockchain-benchmarking-framework/$pipe" ]]; then
mkfifo $WORKING_DIR/blockchain-benchmarking-framework/$pipe
echo "Pipe created"
else
echo "Pipe already exists"
fi
echo "Make the pipe listen forever in background..."
while true; do
eval "$(cat $WORKING_DIR/blockchain-benchmarking-framework/$pipe) &> $WORKING_DIR/output.txt" ;
done