In openflow-switch init script, do not re-load openflow_mod if already loaded.
authorBen Pfaff <blp@nicira.com>
Fri, 31 Oct 2008 15:56:03 +0000 (08:56 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Oct 2008 21:09:53 +0000 (14:09 -0700)
debian/openflow-switch.init

index 13f05dd331f50ec03cfc294b24f85aedfbc0d988..cc5f954a4dd1449bf00af8976b662881856a5087 100755 (executable)
@@ -199,10 +199,12 @@ case "$1" in
         esac
 
         echo -n "Loading openflow_mod: "
-        if modprobe openflow_mod; then
+        if grep -q '^openflow_mod$' /proc/modules; then
+            echo "already loaded, nothing to do."
+        elif modprobe openflow_mod; then
             echo "success."
         else
-            echo " ERROR."
+            echo "ERROR."
             echo "openflow_mod has probably not been built for this kernel."
             if ! test -d /usr/share/doc/openflow-datapath-source; then
                 echo "Install the openflow-datapath-source package, then read"