Changeset 8333
- Timestamp:
- 03/07/12 14:06:17 (16 months ago)
- Location:
- luci/trunk/applications/luci-multiwan/luasrc/model/cbi/multiwan
- Files:
-
- 2 modified
-
multiwan.lua (modified) (1 diff)
-
multiwanmini.lua (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/applications/luci-multiwan/luasrc/model/cbi/multiwan/multiwan.lua
r6211 r8333 5 5 6 6 s = m:section(NamedSection, "config", "multiwan", "") 7 7 8 e = s:option(Flag, "enabled", translate("Enable")) 8 9 e.rmempty = false 10 e.default = e.enabled 9 11 10 12 function e.write(self, section, value) 11 local cmd = (value == "1") and "enable" or "disable" 12 if value ~= "1" then 13 os.execute("/etc/init.d/multiwan stop") 14 end 15 os.execute("/etc/init.d/multiwan " .. cmd) 16 end 17 18 function e.cfgvalue(self, section) 19 return (os.execute("/etc/init.d/multiwan enabled") == 0) and "1" or "0" 13 if value == "0" then 14 os.execute("/etc/init.d/multiwan stop") 15 else 16 os.execute("/etc/init.d/multiwan enable") 17 end 18 Flag.write(self, section, value) 20 19 end 21 20 -
luci/trunk/applications/luci-multiwan/luasrc/model/cbi/multiwan/multiwanmini.lua
r6211 r8333 5 5 6 6 s = m:section(NamedSection, "config", "multiwan", "") 7 7 8 e = s:option(Flag, "enabled", translate("Enable")) 8 9 e.rmempty = false 10 e.default = "1" 9 11 10 12 function e.write(self, section, value) 11 local cmd = (value == "1") and "enable" or "disable" 12 if value ~= "1" then 13 os.execute("/etc/init.d/multiwan stop") 14 end 15 os.execute("/etc/init.d/multiwan " .. cmd) 16 end 17 18 function e.cfgvalue(self, section) 19 return (os.execute("/etc/init.d/multiwan enabled") == 0) and "1" or "0" 13 if value == "0" then 14 os.execute("/etc/init.d/multiwan stop") 15 else 16 os.execute("/etc/init.d/multiwan enable") 17 end 18 Flag.write(self, section, value) 20 19 end 21 20
