OpenWrt defaults to using root to run init scripts
so there is no need to elevate privileges.
A non-privileged user can prefix the script's
execution command with 'sudo'.
Signed-off-by: Georgios Kontaxis <redacted>
config 'etherwake' 'setup'
# possible program paths
option 'pathes' '/usr/bin/etherwake /usr/bin/ether-wake'
- # use sudo, defaults to off
- option 'sudo' 'off'
# interface, defaults to 'eth0'
# -i <ifname>
option 'interface' ''
exit 1
}
- # sudo
- config_get_bool value 'setup' 'sudo' '0'
- [ "${value}" -ne 0 ] && PROGRAM="sudo ${PROGRAM}"
-
# interface
config_get value 'setup' 'interface'
[ -n "${value}" ] && append PROGRAM "-i ${value}"