setup-network-plugin.sh 778 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#!/bin/sh

##
## Setup a OpenStack node to run whichever ML2 plugin we're configured to run.
##

set -x

# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
    echo "This script must be run as root" 1>&2
    exit 1
fi

# Grab our libs
. "`dirname $0`/setup-lib.sh"

if [ -f $OURDIR/setup-network-plugin-done ]; then
    exit 0
fi

22 23
logtstart "network-plugin"

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
if [ -f $SETTINGS ]; then
    . $SETTINGS
fi
if [ -f $LOCALSETTINGS ]; then
    . $LOCALSETTINGS
fi

if [ "${ML2PLUGIN}" = "linuxbridge" ]; then
    $DIRNAME/setup-network-plugin-linuxbridge.sh
else
    $DIRNAME/setup-network-plugin-openvswitch.sh
fi

if [ $? -eq 0 ]; then
    touch $OURDIR/setup-network-plugin-done
39
    logtend "network-plugin"
40 41 42
    exit 0
else
    err=$?
43
    logtend "network-plugin"
44 45
    exit $err
fi