3 # openvswitch-xapi-update
5 # chkconfig: 2345 95 01
6 # description: Update Open vSwitch configuration from XAPI database at boot
8 # Copyright (C) 2009, 2010 Nicira, Inc.
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at:
14 # http://www.apache.org/licenses/LICENSE-2.0
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
22 # Provides: openvswitch-xapi-update
23 # Required-Start: $network $remote_fs
24 # Required-Stop: $network
27 # Short-Description: openvswitch-xapi-update
28 # Description: reconfigures Open vSwitch based on XAPI configuration
31 . /etc/init.d/functions
33 function do_host_call {
34 xe host-call-plugin host-uuid="$INSTALLATION_UUID" plugin="openvswitch-cfg-update" fn="update" >/dev/null
38 if [ ! -f /etc/xensource-inventory ]; then
39 printf "openvswitch-xapi-update ERROR: XenSource inventory not present in /etc/xensource-inventory\n"
43 if test -e /etc/xensource/network.conf; then
44 NETWORK_MODE=$(cat /etc/xensource/network.conf)
47 case ${NETWORK_MODE:=openvswitch} in
54 echo "Open vSwitch disabled (/etc/xensource/network.conf is invalid)" >&2
59 source /etc/xensource-inventory
60 action "Updating configuration" do_host_call
74 printf "openvswitch-xapi-update [start|stop|restart]\n"
77 printf "Unknown command: $1\n"