From: Michael Tremer Date: Thu, 20 Sep 2018 21:42:54 +0000 (+0100) Subject: Restart ports after edit to apply settings X-Git-Tag: 010~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79271f35637597ac51c13e733147d3c4be00b0f6;p=network.git Restart ports after edit to apply settings Signed-off-by: Michael Tremer --- diff --git a/src/header-port b/src/header-port index 158a7cb7..489958fa 100644 --- a/src/header-port +++ b/src/header-port @@ -81,6 +81,9 @@ hook_default_edit() { return ${EXIT_ERROR} fi + # Apply settings + port_restart "${port}" + return ${EXIT_OK} } diff --git a/src/hooks/ports/ethernet b/src/hooks/ports/ethernet index 6f4ac68a..ce48ecdd 100644 --- a/src/hooks/ports/ethernet +++ b/src/hooks/ports/ethernet @@ -68,8 +68,13 @@ hook_new() { } hook_create() { - # Nothing to do here. Real ethernet devices cannot - # be created. They are just there. + local port="${1}" + + # Set MAC address, if needed + if isset ADDRESS; then + device_set_address "${port}" "${ADDRESS}" + fi + exit ${EXIT_OK} } @@ -95,13 +100,7 @@ hook_hotplug_rename() { if list_match "${address}" ${DEVICE} ${ADDRESS}; then log DEBUG "Device '${device}' equals port '${port}'." - # Change the MAC address, if needed. - if isset ADDRESS; then - device_set_address "${device}" "${ADDRESS}" - fi - - # Everything is done. - exit ${EXIT_OK} + hook_create "${device}" fi log DEBUG "Device '${device}' does not equal port '${port}'."