From: Georgios Kontaxis Date: Sun, 21 Jun 2026 20:08:12 +0000 (+0000) Subject: etherwake: human-readable section name in console output X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=3e77dadff5e1aa7642709917e4b859e91676d579;p=openwrt-packages.git etherwake: human-readable section name in console output Log 'name' when referring to a configuration 'target'. Signed-off-by: Georgios Kontaxis --- diff --git a/net/etherwake/files/etherwake.init b/net/etherwake/files/etherwake.init index 1958785b5..1ca4cc6e6 100644 --- a/net/etherwake/files/etherwake.init +++ b/net/etherwake/files/etherwake.init @@ -65,6 +65,7 @@ do_etherwake() local value='' local password='' local args='' + local section_name='' # password (legacy option) config_get value "${section}" 'password' @@ -80,17 +81,18 @@ do_etherwake() append args "-p ${password}" fi + # name + config_get section_name "${section}" 'name' + [ -z "${section_name}" ] && section_name="${section}" + # mac address config_get value "${section}" 'mac' - [ -z "${value}" ] && { echo "${initscript}: Target ${section} has no MAC address"; return 1; } + [ -z "${value}" ] && { + echo "Target '${section_name}' has no 'mac' address"; return 1; } append args "${value}" - # name - config_get value "${section}" 'name' - [ -z "${value}" ] && value="{section}" - # execute command - echo "${initscript}: Waking up ${value} via ${PROGRAM}${args:+ ${args}}" + echo "Waking up '${section_name}' via ${PROGRAM}${args:+ ${args}}" ${PROGRAM} ${args} return $? }