-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·44 lines (37 loc) · 849 Bytes
/
run
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
CURRENT_DIR=$(pwd)
DB_PATH=$1
DATA_COLLECTION_PATH="data_collection"
START_MATCH_ID=$2
check_db_exists() {
if [ ! -f "$DB_PATH" ]; then
return 1
else
return 0
fi
}
create_db() {
echo "Database not found. Creating the database..."
python3 installdb $DB_PATH
if [ $? -eq 0 ]; then
echo "Database created successfully."
else
echo "Error creating database."
exit 1
fi
}
run_data_collection() {
echo "Entering data_collection directory and running main.py..."
cd "$DATA_COLLECTION_PATH" || exit 1
python3 main.py $DB_PATH $START_MATCH_ID
if [ $? -eq 0 ]; then
echo "main.py executed successfully."
else
echo "Error executing main.py."
exit 1
fi
}
if ! check_db_exists; then
create_db
fi
run_data_collection