diff options
author | Florian Eckert <fe@dev.tdt.de> | 2018-08-29 15:14:27 +0200 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2019-04-25 10:15:52 +0200 |
commit | bea3879009c5c309b59e7f0972fbed9d1487a529 (patch) | |
tree | 583a7264194b265837d7bab4def0d48c5ad1cbf6 /modules/luci-base | |
parent | 3ffdf4160fad723b87cb0df6e3a89b3e164067ee (diff) |
luci-base: add is_auto function
Add missing is_auto getter function.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/model/network.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 49e1657aae..dec25a5d0b 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -1159,6 +1159,16 @@ function protocol.is_dynamic(self) return (self:_ubus("dynamic") == true) end +function protocol.is_auto(self) + local auto = self:_get("auto") + + if auto == "0" then + return false + else + return true + end +end + function protocol.is_alias(self) local ifn, parent = nil, nil |