-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·97 lines (75 loc) · 2.7 KB
/
install.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
# USAGE 1) Run "bash install.sh [scenario]". Available scenarios:
# (i) chemical-plant-scenario, (ii) mva-scenario,
# (iii) high-school-shooting-scenario
# USAGE 2) Run "bash install.sh" and follow the instructions
NS3_MMWAVE_URL="https://github.com/nyuwireless-unipd/ns3-mmwave.git"
NS3_MMWAVE_IAB_URL="https://github.com/signetlabdei/ns3-mmwave-iab"
NS3_MMWAVE_LAST_COMMIT="cbfb03d06c15aa82d0297a105bb373db88d1bb5c"
if [ $# -gt 0 ]; then
if [ "$1" == "chemical-plant-scenario" ]; then
choice=1
elif [ "$1" == "mva-scenario" ]; then
choice=2
elif [ "$1" == "high-school-shooting-scenario" ]; then
choice=3
else
echo -e "Run "bash install.sh" [scenario]\n\nAvailable scenarios:\nchemical-plant-scenario\nmva-scenario\nhigh-school-shooting-scenario\n"
exit 1
fi
else
echo -e "This script will install the desired PSC scenario.\nChoose between the following:\n[1] Chemical plant explosion\n[2] Multi-vehicle accident\n[3] High school shooting\n"
exit=false
while [ $exit = false ]; do
read choice
if [ $choice = 1 ] || [ $choice = 2 ] || [ $choice = 3 ]; then
exit=true
else
echo -e "Please choose 1, 2 or 3"
fi
done
fi
if [ $choice = 1 ]; then
echo -e "Installing the chemical plant scenario..."
# Clone the ns3-mmwave module
INSTALLATION_FOLDER="chemical-plant"
git clone -b new-handover $NS3_MMWAVE_URL $INSTALLATION_FOLDER
# Appy the patch
cd $INSTALLATION_FOLDER
git reset --hard $NS3_MMWAVE_LAST_COMMIT
patch -p1 < ../.patches/ns3-mmwave-psc.patch
# Copy the example
cp ../psc-scenarios/chemical-plant-scenario.cc scratch/.
# Configure the ns3-module
./waf configure --disable-python
./waf build
elif [ $choice = 2 ]; then
echo -e "Installing the multi-vehicle accident scenario..."
INSTALLATION_FOLDER="multi-vehicle-accident"
# Clone the ns3-mmwave module
git clone -b new-handover $NS3_MMWAVE_URL $INSTALLATION_FOLDER
# Appy the patch
cd $INSTALLATION_FOLDER
git reset --hard $NS3_MMWAVE_LAST_COMMIT
patch -p1 < ../.patches/ns3-mmwave-psc.patch
# Copy the example
cp ../psc-scenarios/mva-scenario.cc scratch/.
# Configure the ns3-module
./waf configure --disable-python
./waf build
elif [ $choice = 3 ]; then
echo -e "Installing the high school shooting scenario..."
INSTALLATION_FOLDER="high-school-shooting"
# Clone the ns3-mmwave module
git clone -b iab-release $NS3_MMWAVE_IAB_URL $INSTALLATION_FOLDER
# Appy the patch
cd $INSTALLATION_FOLDER
patch -p1 < ../.patches/ns3-mmwave-iab-psc.patch
# Copy the example
cp ../psc-scenarios/psc-shooting-swat.cc scratch/.
# Configure the ns3-module
./waf configure --disable-python
./waf build
else
echo -e "Somethig went wrong.."
fi