diff options
author | Manuel Munz <freifunk@somakoma.de> | 2013-10-17 00:01:06 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2013-10-17 00:01:06 +0000 |
commit | 0678fe5eeb2827508858b7ca6509cf8447db4484 (patch) | |
tree | 878879137451f72ebb1f99d90dcfaa99fd6c2562 /applications/luci-splash/root | |
parent | 4ae0d30edd7a55352828afc8a45e20a581d22440 (diff) |
applications/luci-splash: Do not allow to lease whitelisted clients
Diffstat (limited to 'applications/luci-splash/root')
-rwxr-xr-x | applications/luci-splash/root/usr/sbin/luci-splash | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index d2b860e58..5051d60b7 100755 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -13,7 +13,7 @@ local net = sys.net local fs = require "luci.fs" local ip = require "luci.ip" -local debug = false +local debug = true local has_ipv6 = fs.access("/proc/net/ipv6_route") and fs.access("/usr/sbin/ip6tables") @@ -183,9 +183,19 @@ function main(argv) end if cmd ~= "whitelist" and whitelist_macs[mac] then - print("Removing %s from whitelist" % mac) - remove_whitelist(mac) - whitelist_macs[mac] = nil + if cmd == "lease" then + print('%s is whitelisted. Remove it before you can lease it.' % mac) + else + print("Removing %s from whitelist" % mac) + remove_whitelist(mac) + whitelist_macs[mac] = nil + end + end + + if cmd == "whitelist" and leased_macs[mac] then + print("Removing %s from leases" % mac) + remove_lease(mac) + leased_macs[mac] = nil end if cmd ~= "blacklist" and blacklist_macs[mac] then @@ -195,9 +205,11 @@ function main(argv) end if cmd == "lease" and not leased_macs[mac] then - print("Adding %s to leases" % mac) - add_lease(mac) - leased_macs[mac] = true + if not whitelist_macs[mac] then + print("Adding %s to leases" % mac) + add_lease(mac) + leased_macs[mac] = true + end elseif cmd == "whitelist" and not whitelist_macs[mac] then print("Adding %s to whitelist" % mac) add_whitelist(mac) |