]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/udev/network-hotplug
Let hotplug handlers return a status code
[people/stevee/network.git] / src / udev / network-hotplug
index 7b664a9f23546b2154c0c197685083b1202b9ba1..a9787c4977690c4c8effb0b8518225d20af2323b 100644 (file)
@@ -72,7 +72,21 @@ case "${ACTION}" in
 
                                        # Create configured child devices.
                                        for port in $(ports_get_all); do
-                                               port_cmd hotplug ${port} ${phy}
+                                               port_cmd hotplug "${port}" "${phy}"
+                                               ret=$?
+
+                                               case "${ret}" in
+                                                       ${EXIT_OK})
+                                                               log DEBUG "phy '${phy}' was handled by port '${port}'"
+                                                               break
+                                                               ;;
+                                                       ${EXIT_NOT_HANDLED})
+                                                               log DEBUG "phy '${phy}' was not handled by port '${port}'"
+                                                               ;;
+                                                       *)
+                                                               log WARNING "Unknown exit code for port '${port}': ${ret}"
+                                                               ;;
+                                               esac
                                        done
                                        ;;