openvswitch-switch.init: Redirect error to /dev/null.
authorGurucharan Shetty <guru@ovn.org>
Tue, 5 Jan 2016 18:13:39 +0000 (10:13 -0800)
committerGurucharan Shetty <guru@ovn.org>
Tue, 5 Jan 2016 19:38:10 +0000 (11:38 -0800)
The latest Open vSwitch kernel module from Upstream linux does not
list "version". During debian package installation, we would see
a non-harmful error in the log. This patch suppresses it.

Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
debian/openvswitch-switch.init

index aece780..a045f3b 100755 (executable)
@@ -87,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`