]> git.ipfire.org Git - people/stevee/network.git/blobdiff - src/hooks/ports/ethernet
hotplug: Remove multiple copies of the same function
[people/stevee/network.git] / src / hooks / ports / ethernet
index 5f76e1588baf1ed80a6dae1e8bed8ff4bd87dd43..82664fa15376198d712e1fed7267d0025a2d21be 100644 (file)
@@ -173,25 +173,5 @@ hook_remove() {
 }
 
 hook_hotplug_rename() {
-       local port=${1}
-       assert isset port
-
-       local device=${2}
-       assert isset device
-
-       # Read in the conifguration file.
-       port_settings_read "${port}"
-
-       # Get the current MAC address of the device.
-       local address=$(device_get_address ${device})
-       assert isset address
-
-       # Check if the address matches with the configuration.
-       if list_match "${address}" ${DEVICE} ${ADDRESS}; then
-               log DEBUG "Device '${device}' equals port '${port}'."
-               exit ${EXIT_OK}
-       fi
-
-       log DEBUG "Device '${device}' does not equal port '${port}'."
-       exit ${EXIT_ERROR}
+       hook_hotplug_rename_by_address "$@"
 }