默认的OPENWRT的WOL功能几乎是无法使用的,如果要使用需要修改启动文件,增加启动参数
vi /etc/init.d/wol
start_service() {
local cfg="$1"
args=""
append_string "$cfg" broadcast "--host="
append_string "$cfg" port "--port="
append_string "$cfg" password "--passwd="
append_string "$cfg" mac ""
config_get_bool enabled "$cfg" "enabled" '1'
[ "$enabled" -gt 0 ] && /usr/bin/wol $args
}
vi /etc/config/wol
config wol-target
option mac ''
option broadcast '172.16.1.255'
option port '9'
option enabled '1'
其中172.16.1是网络号,然后255则是该网络的广播地址
port=9可以增加,也可以不增加
如果是etherwake的话,直接修改即可
/usr/lib/lua/luci/model/cbi/wol.lua 把 cmd = “%s -D%s %q” %{ 改成 cmd = “%s -b -D%s %q” %{