From bea3879009c5c309b59e7f0972fbed9d1487a529 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 29 Aug 2018 15:14:27 +0200 Subject: luci-base: add is_auto function Add missing is_auto getter function. Signed-off-by: Florian Eckert --- modules/luci-base/luasrc/model/network.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'modules/luci-base/luasrc/model/network.lua') diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 49e1657aa..dec25a5d0 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 -- cgit v1.2.3