]> git.ipfire.org Git - people/ms/network.git/blobdiff - hooks/ports/ethernet
hotplug: Return port name for a device.
[people/ms/network.git] / hooks / ports / ethernet
index 2d49f49aee17d553dc11ac4c69260b92128da319..cf37aa05cf78d25ee9970172f5b38efc69d464c2 100755 (executable)
@@ -60,6 +60,22 @@ function _down() {
        exit ${EXIT_OK}
 }
 
+function _hotplug() {
+       local port=${1}
+       local device=${2}
+
+       assert isset port
+       assert isset device
+
+       config_read $(port_file ${port})
+
+       if [ "${DEVICE_MAC}" = "$(device_get_address ${device})" ]; then
+               exit ${EXIT_OK}
+       fi
+
+       exit ${EXIT_ERROR}
+}
+
 function _status() {
        local port=${1}
        shift