-ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl
-case $1 in
- start)
- set $ovs_ctl start --system-id=random
- if test X"$FORCE_COREFILES" != X; then
- set "$@" --force-oorefiles="$FORCE_COREFILES"
+network_interfaces () {
+ INTERFACES="/etc/network/interfaces"
+ [ -e "${INTERFACES}" ] || return
+ bridges=`awk '{ if ($1 == "allow-ovs") { print $2; } }' "${INTERFACES}"`
+ [ -n "${bridges}" ] && $1 --allow=ovs ${bridges}
+}
+
+load_kmod () {
+ ovs_ctl load-kmod || exit $?
+}
+
+start () {
+ if ovs_ctl load-kmod; then
+ :
+ else
+ echo "Module has probably not been built for this kernel."
+ if ! test -d /usr/share/doc/openvswitch-datapath-source; then
+ echo "Install the openvswitch-datapath-source package, then read"
+ else
+ echo "For instructions, read"