tunnel: test VXLAN receive and UDP checksum
[cascardo/ovs.git] / debian / openvswitch-switch.init
index bf84477..a045f3b 100755 (executable)
 
 (test -x /usr/sbin/ovs-vswitchd && test -x /usr/sbin/ovsdb-server) || exit 0
 
+_SYSTEMCTL_SKIP_REDIRECT=yes
+
 . /usr/share/openvswitch/scripts/ovs-lib
 test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch
 
 network_interfaces () {
     INTERFACES="/etc/network/interfaces"
     [ -e "${INTERFACES}" ] || return
-    bridges=`awk '{ if ($1 == "allow-ovs") { print $2; } }' "${INTERFACES}"`
+    bridges=`ifquery --allow ovs --list`
     [ -n "${bridges}" ] && $1 --allow=ovs ${bridges}
 }
 
@@ -85,11 +87,15 @@ restart () {
         depmod -a
 
         if [ -e /sys/module/openvswitch ]; then
-            LOADED_SRCVERSION=`cat /sys/module/openvswitch/srcversion`
-            LOADED_VERSION=`cat /sys/module/openvswitch/version`
+            LOADED_SRCVERSION=`cat /sys/module/openvswitch/srcversion \
+                               2>/dev/null`
+            LOADED_VERSION=`cat /sys/module/openvswitch/version \
+                            2>/dev/null`
         elif [ -e /sys/module/openvswitch_mod ]; then
-            LOADED_SRCVERSION=`cat /sys/module/openvswitch_mod/srcversion`
-            LOADED_VERSION=`cat /sys/module/openvswitch_mod/version`
+            LOADED_SRCVERSION=`cat /sys/module/openvswitch_mod/srcversion \
+                               2>/dev/null`
+            LOADED_VERSION=`cat /sys/module/openvswitch_mod/version \
+                            2>/dev/null`
         fi
         SRCVERSION=`modinfo -F srcversion openvswitch 2>/dev/null`
         VERSION=`modinfo -F version openvswitch 2>/dev/null`