forked from dlinknctu/OpenADM
-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
executable file
·70 lines (56 loc) · 1.02 KB
/
run.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
#!/bin/bash
function install_floodlight {
cd $rootpath/..
$rootpath/adapter/floodlight/install.sh
}
function test_core {
cd $rootpath/core
python setup.py test
}
function install_core {
cd $rootpath/core
python setup.py install --user
}
function install_ui {
cd $rootpath/ui
npm install
}
function test_ui {
cd $rootpath/ui
npm test
}
function install {
install_floodlight
install_core
install_ui
}
function test {
install
test_ui
test_core
}
function setup {
if [ $# != 2 ]; then
echo "Usage: $0 exec <IP> <Port>"
exit -1
fi
UI_CONFIG="$OPENADM_ROOT/ui/config/config.json"
# Config IP address
rm -rf $UI_CONFIG
echo "{" > $UI_CONFIG
echo " \"OpenADMCoreURL\": \"http://$1:$2/\"" >> $UI_CONFIG
echo "}" >> $UI_CONFIG
}
function controller {
$OPENADM_ROOT/../floodlight/floodlight.sh
}
function core {
/root/.local/bin/omniui
}
function ui {
cd $OPENADM_ROOT/ui/
npm run dev &> /tmp/omniui/ui.log &
}
rootpath=`pwd`
OPENADM_ROOT=`dirname $0`
$@