-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·65 lines (50 loc) · 1.55 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
#!/bin/bash
usage="usage: $0 /path/to/pre-compiled/openvswitch/source/directory"
if [ -z $1 ]; then
echo $usage
exit 1
fi
user=`whoami`
if [ $user != "root" ]; then
echo 'must be root'
exit 1
fi
cd `dirname $0`
cp ./bin/* /usr/local/bin/
for script in `ls ./bin`; do
ln -s /usr/local/bin/${script} /usr/bin/${script}
done
mkdir -p /usr/local/etc/ovs-testing/guests/guest1
mkdir -p /usr/local/etc/ovs-testing/guests/guest2
echo '00:11:22:AA:BB:DD' > /usr/local/etc/ovs-testing/guests/guest1/mac_addr
echo '00:11:22:CC:AA:DD' > /usr/local/etc/ovs-testing/guests/guest2/mac_addr
mkdir -p /usr/local/etc/ovs-testing/guests/guest1/copy_into_filesystem/etc/network
mkdir -p /usr/local/etc/ovs-testing/guests/guest2/copy_into_filesystem/etc/network
cat > /usr/local/etc/ovs-testing/guests/guest1/copy_into_filesystem/etc/network/interfaces <<EOT
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.0.0.201
netmask 255.255.255.0
EOT
echo '10.0.0.201' > /usr/local/etc/ovs-testing/guests/guest1/ip
cat > /usr/local/etc/ovs-testing/guests/guest2/copy_into_filesystem/etc/network/interfaces <<EOT
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.0.0.202
netmask 255.255.255.0
EOT
echo '10.0.0.202' > /usr/local/etc/ovs-testing/guests/guest2/ip
mkdir -p /usr/local/etc/
cp ./etc/* /usr/local/etc/
cd $1
if [ ! -e datapath/linux-2.6/openvswitch_mod.ko ]; then
echo 'Error: datapath/linux-2.6/openvswitch_mod.ko not found in open vSwitch sources'
exit 1
else
mkdir -p /usr/local/src/
ln -sf $1 /usr/local/src/ovs-src
fi