From 3d41d7f534eaba94c499ddeca9826b9c4517cb08 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 24 Dec 2014 00:01:42 -0800 Subject: tools: fix the name Signed-off-by: FUJITA Tomonori --- tools/config/root-server-docker.sh | 69 ------------------------------------- tools/config/route-server-docker.sh | 69 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 69 deletions(-) delete mode 100755 tools/config/root-server-docker.sh create mode 100755 tools/config/route-server-docker.sh (limited to 'tools/config') diff --git a/tools/config/root-server-docker.sh b/tools/config/root-server-docker.sh deleted file mode 100755 index fe8fe31c..00000000 --- a/tools/config/root-server-docker.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -NR_PEERS=8 -BRIDGE_NAME=br0 -CONFIG_DIR=`pwd` - -run_quagga() { - local docker_name=q$1 - docker run --privileged=true -v $CONFIG_DIR/$docker_name:/etc/quagga --name $docker_name -id osrg/quagga - sudo pipework $BRIDGE_NAME $docker_name 10.0.0.$1/16 -} - -stop_quagga() { - local docker_name=q$1 - docker rm -f $docker_name -} - -delete_bridge() { - local name=$1 - local sysfs_name=/sys/class/net/$name - if [ -e $sysfs_name ]; then - sudo ifconfig $name down - sudo brctl delbr $name - fi -} - -while getopts c:n: OPT -do - case $OPT in - c) CONFIG_DIR="$OPTARG" - ;; - n) NR_PEERS="$OPTARG" - ;; - *) echo "Unknown option" - exit 1 - ;; - esac -done - -shift $((OPTIND - 1)) - -case "$1" in - start) - i=1 - while [ $i -le $NR_PEERS ] - do - run_quagga $i - i=$(( i+1 )) - done - sudo ip addr add 10.0.255.1/16 dev $BRIDGE_NAME - ;; - - stop) - i=1 - while [ $i -le $NR_PEERS ] - do - stop_quagga $i - i=$(( i+1 )) - done - delete_bridge $BRIDGE_NAME - ;; - *) - echo $1 - echo "Usage: root-server-docker {start|stop}" - exit 2 - ;; -esac - - diff --git a/tools/config/route-server-docker.sh b/tools/config/route-server-docker.sh new file mode 100755 index 00000000..fe8fe31c --- /dev/null +++ b/tools/config/route-server-docker.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +NR_PEERS=8 +BRIDGE_NAME=br0 +CONFIG_DIR=`pwd` + +run_quagga() { + local docker_name=q$1 + docker run --privileged=true -v $CONFIG_DIR/$docker_name:/etc/quagga --name $docker_name -id osrg/quagga + sudo pipework $BRIDGE_NAME $docker_name 10.0.0.$1/16 +} + +stop_quagga() { + local docker_name=q$1 + docker rm -f $docker_name +} + +delete_bridge() { + local name=$1 + local sysfs_name=/sys/class/net/$name + if [ -e $sysfs_name ]; then + sudo ifconfig $name down + sudo brctl delbr $name + fi +} + +while getopts c:n: OPT +do + case $OPT in + c) CONFIG_DIR="$OPTARG" + ;; + n) NR_PEERS="$OPTARG" + ;; + *) echo "Unknown option" + exit 1 + ;; + esac +done + +shift $((OPTIND - 1)) + +case "$1" in + start) + i=1 + while [ $i -le $NR_PEERS ] + do + run_quagga $i + i=$(( i+1 )) + done + sudo ip addr add 10.0.255.1/16 dev $BRIDGE_NAME + ;; + + stop) + i=1 + while [ $i -le $NR_PEERS ] + do + stop_quagga $i + i=$(( i+1 )) + done + delete_bridge $BRIDGE_NAME + ;; + *) + echo $1 + echo "Usage: root-server-docker {start|stop}" + exit 2 + ;; +esac + + -- cgit v1.2.3