X-Git-Url: http://git.ipfire.org/?p=people%2Fms%2Fnetwork.git;a=blobdiff_plain;f=src%2Fhooks%2Fports%2Fethernet;h=82664fa15376198d712e1fed7267d0025a2d21be;hp=f3e3f9fdf9baade9c92284e17318b424671fd0ad;hb=12f9c8d2550c8fcab536bb8b971caddfa8ee0c80;hpb=d389e96b6c0a73fefd907bc99401b4ce4021bf97 diff --git a/src/hooks/ports/ethernet b/src/hooks/ports/ethernet index f3e3f9fd..82664fa1 100644 --- a/src/hooks/ports/ethernet +++ b/src/hooks/ports/ethernet @@ -117,7 +117,7 @@ hook_new() { local DEVICE="$(device_get_address "${device}")" - if ! port_settings_write "${port}" ${HOOK_SETTINGS[*]}; then + if ! port_settings_write "${port}"; then log ERROR "Could not write settings for port ${port}" return ${EXIT_ERROR} fi @@ -133,7 +133,7 @@ hook_up() { local port="${1}" local ${HOOK_SETTINGS[*]} - if ! port_settings_read "${port}" ${HOOK_SETTINGS[*]}; then + if ! port_settings_read "${port}"; then log ERROR "Could not read settings for port ${port}" return ${EXIT_ERROR} fi @@ -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}" ${HOOK_SETTINGS[*]} - - # 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 "$@" }