From: Georgios Kontaxis Date: Sun, 21 Jun 2026 18:17:54 +0000 (+0000) Subject: etherwake: simplify password handling X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=5e478e02aa1b73869f059988452c79dbd0cf347d;p=openwrt-packages.git etherwake: simplify password handling Signed-off-by: Georgios Kontaxis --- diff --git a/net/etherwake/files/etherwake.config b/net/etherwake/files/etherwake.config index f55bf8a41..e3ebfcbd9 100644 --- a/net/etherwake/files/etherwake.config +++ b/net/etherwake/files/etherwake.config @@ -11,8 +11,8 @@ config 'target' option 'name' 'example' # mac address to wake up option 'mac' '11:22:33:44:55:66' - # password in hex without any delimiters - option 'password' 'AABBCCDDEEFF' + # password in ethernet hex format + option 'password' 'AA:BB:CC:DD:EE:FF' # wake up on system start, defaults to off option 'wakeonboot' 'off' diff --git a/net/etherwake/files/etherwake.init b/net/etherwake/files/etherwake.init index f26779609..27d64f823 100644 --- a/net/etherwake/files/etherwake.init +++ b/net/etherwake/files/etherwake.init @@ -70,10 +70,7 @@ do_etherwake() # password config_get value "${section}" 'password' - [ -n "${value}" ] && { - password=$(etherwake_password "${value}") - append args "-p ${password}" - } + [ -n "${value}" ] && append args "-p ${value}" # mac address config_get value "${section}" 'mac' @@ -89,13 +86,3 @@ do_etherwake() ${PROGRAM} ${args} return $? } - - -# prepare hex password -etherwake_password() -{ - local delimiter=':' - local password=`echo "$1" | sed "s/../&${delimiter}/g"` - echo "${password%${delimiter}}" - return -}