etherwake: human-readable section name in console output
authorGeorgios Kontaxis <redacted>
Sun, 21 Jun 2026 20:08:12 +0000 (20:08 +0000)
committerGeorgios Kontaxis <redacted>
Sun, 21 Jun 2026 20:21:07 +0000 (20:21 +0000)
Signed-off-by: Georgios Kontaxis <redacted>
net/etherwake/files/etherwake.init

index 661f9edd677780f41b83e890d6da67c1fff2a90c..e7e8c49548ecddc9eb2c3ca5b1ab9405fa2470a2 100644 (file)
@@ -67,22 +67,23 @@ do_etherwake()
        local value=''
        local password=''
        local args=''
+       local section_name=''
 
        # password
        config_get value "${section}" 'password'
        [ -n "${value}" ] && append args "-p ${value}"
 
+       # 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 "${initscript}: 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 "${initscript}: Waking up ${section_name} via ${PROGRAM}${args:+ ${args}}"
        ${PROGRAM} ${args}
        return $?
 }
git clone https://git.99rst.org/PROJECT