diff options
Diffstat (limited to 'applications/luci-app-wol')
-rw-r--r-- | applications/luci-app-wol/luasrc/controller/wol.lua | 4 | ||||
-rw-r--r-- | applications/luci-app-wol/luasrc/model/cbi/wol.lua | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/applications/luci-app-wol/luasrc/controller/wol.lua b/applications/luci-app-wol/luasrc/controller/wol.lua index 73a9594b2a..dbbfdde128 100644 --- a/applications/luci-app-wol/luasrc/controller/wol.lua +++ b/applications/luci-app-wol/luasrc/controller/wol.lua @@ -1,6 +1,6 @@ module("luci.controller.wol", package.seeall) function index() - entry({"admin", "network", "wol"}, cbi("wol"), _("Wake on LAN"), 90) - entry({"mini", "network", "wol"}, cbi("wol"), _("Wake on LAN"), 90) + entry({"admin", "services", "wol"}, cbi("wol"), _("Wake on LAN"), 90) + entry({"mini", "services", "wol"}, cbi("wol"), _("Wake on LAN"), 90) end diff --git a/applications/luci-app-wol/luasrc/model/cbi/wol.lua b/applications/luci-app-wol/luasrc/model/cbi/wol.lua index e87cac3dc2..ec6a1be2a8 100644 --- a/applications/luci-app-wol/luasrc/model/cbi/wol.lua +++ b/applications/luci-app-wol/luasrc/model/cbi/wol.lua @@ -48,6 +48,13 @@ sys.net.mac_hints(function(mac, name) host:value(mac, "%s (%s)" %{ mac, name }) end) +if has_ewk then + broadcast = s:option(Flag, "broadcast", + translate("Send to broadcast address")) + if has_wol then + broadcast:depends("binary", "/usr/bin/etherwake") + end +end function host.write(self, s, val) local host = luci.http.formvalue("cbid.wol.1.mac") @@ -59,8 +66,10 @@ function host.write(self, s, val) if util == "/usr/bin/etherwake" then local iface = luci.http.formvalue("cbid.wol.1.iface") - cmd = "%s -D%s %q" %{ - util, (iface ~= "" and " -i %q" % iface or ""), host + local broadcast = luci.http.formvalue("cbid.wol.1.broadcast") + cmd = "%s -D%s %s %q" %{ + util, (iface ~= "" and " -i %q" % iface or ""), + (broadcast == "1" and " -b" or ""), host } else cmd = "%s -v %q" %{ util, host } |