-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-corefiles="$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}
+}
+
+ovs_ctl () {
+ set /usr/share/openvswitch/scripts/ovs-ctl "$@"
+ "$@"
+}
+
+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"
+ fi
+ echo "/usr/share/doc/openvswitch-datapath-source/README.Debian"
+
+ if test X"$OVS_MISSING_KMOD_OK" = Xyes; then
+ # We're being invoked by the package postinst. Do not
+ # fail package installation just because the kernel module
+ # is not available.
+ exit 0