summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2016-05-31 15:41:38 +0800
committerGuo Ruijing <ruijing.guo@intel.com>2016-05-31 15:42:47 +0800
commita8359af0ca39da09493c62cca9325b087b23a185 (patch)
tree6fb52d0e5a1d1c2cce412421c35556c8c9cb3dfe
parent6e3f8973df9ba87729f9f94bd45c937f46b942c7 (diff)
Add parameters to setup network
Change-Id: I3a5f52f9df396e70456e511509dfdd27e25a8bc7 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Notes
Notes (review): Code-Review+2: Ruijing <ruijing.guo@intel.com> Workflow+1: Ruijing <ruijing.guo@intel.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 31 May 2016 07:39:45 +0000 Reviewed-on: https://review.openstack.org/323176 Project: openstack/fuel-plugin-ovs Branch: refs/heads/master
-rwxr-xr-xdemo/01_setup_network.sh38
-rw-r--r--demo/README.md2
2 files changed, 33 insertions, 7 deletions
diff --git a/demo/01_setup_network.sh b/demo/01_setup_network.sh
index 694eca2..fefac8f 100755
--- a/demo/01_setup_network.sh
+++ b/demo/01_setup_network.sh
@@ -1,8 +1,34 @@
1#!/bin/sh 1#!/bin/sh
2HTTP_PROXY=http://10.19.8.225:911 2
3DNS_SERVER=10.248.2.1 3HTTP_PROXY=${HTTP_PROXY:-http://10.19.8.225:911}
4SOCK5_IP=10.7.211.16 4DNS_SERVER=${DNS_SERVER:-10.248.2.1}
5SOCK5_PORT=1080 5SOCKS5_IP=${SOCKS5_IP:-10.7.211.16}
6SOCKS5_PORT=${SOCKS5:-1080}
7
8for i in "$@"
9do
10case $i in
11 -h=*|--http=*)
12 HTTP_PROXY="${i#*=}"
13 shift
14 ;;
15 -d=*|--dns=*)
16 DNS_SERVER="${i#*=}"
17 shift
18 ;;
19 -s=*|--socks5-ip=*)
20 SOCKS5_IP="${i#*=}"
21 shift
22 ;;
23 -p=*|--socks5-port=*)
24 SOCKS5_PORT="${i#*=}"
25 shift
26 ;;
27 *)
28 # unknown option
29 ;;
30esac
31done
6 32
7cat <<EOF | sudo tee /etc/apt/apt.conf 33cat <<EOF | sudo tee /etc/apt/apt.conf
8Acquire::http::Proxy "$HTTP_PROXY"; 34Acquire::http::Proxy "$HTTP_PROXY";
@@ -23,8 +49,8 @@ base {
23redsocks { 49redsocks {
24 local_ip = 0.0.0.0; 50 local_ip = 0.0.0.0;
25 local_port = 6666; 51 local_port = 6666;
26 ip = $SOCK5_IP; 52 ip = $SOCKS5_IP;
27 port = $SOCK5_PORT; 53 port = $SOCKS5_PORT;
28 type = socks5; 54 type = socks5;
29} 55}
30 56
diff --git a/demo/README.md b/demo/README.md
index 6d41cd1..a19525e 100644
--- a/demo/README.md
+++ b/demo/README.md
@@ -31,7 +31,7 @@ d. SOCK5_PORT: socks5 proxy for fuel VM
31 31
32In fresh installation, 01_setup_network.sh can be run by: 32In fresh installation, 01_setup_network.sh can be run by:
33 33
34curl --socks5 <socks5 proxy> https://raw.githubusercontent.com/openstack/fuel-plugin-ovs/master/demo/01_setup_network.sh | bash 34curl --socks5 <socks5-proxy> https://raw.githubusercontent.com/openstack/fuel-plugin-ovs/master/demo/01_setup_network.sh | bash -s -- -h=<http-proxy>-d=<dns-server> -s=<socks5-ip> -p=<socks5-port>
35 35
362. 02_install_packages.sh 362. 02_install_packages.sh
37 37