applications/splash: Fix blacklisting mechanism, expose status on public freifunk...
[project/luci.git] / applications / luci-splash / root / usr / sbin / luci-splash
index 62c2ac6350335d741e3fee41f65028b4cddbce15..ae459ad726df332278e3827470afaf31392d682f 100755 (executable)
@@ -14,7 +14,7 @@ local limit_up = 0
 local limit_down = 0
 
 function lock()
-       os.execute("lock -w /var/run/luci_splash.lock && lock /var/run/luci_splash.lock")
+       os.execute("lock /var/run/luci_splash.lock")
 end
 
 function unlock()
@@ -315,7 +315,6 @@ end
 -- Add blacklist rules
 function add_blacklist_rule(mac)
        os.execute("iptables -t filter -I luci_splash_filter -m mac --mac-source %q -j DROP" % mac)
-       os.execute("iptables -t nat    -I luci_splash_leases -m mac --mac-source %q -j DROP" % mac)
 end
 
 
@@ -380,7 +379,7 @@ function list()
        -- Get current arp cache
        local arpcache = { }
        for _, entry in ipairs(net.arptable()) do
-               arpcache[entry["HW address"]:lower()] = { entry["Device"], entry["IP address"] }
+               arpcache[entry["HW address"]:lower()] = { entry["Device"]:lower(), entry["IP address"]:lower() }
        end
 
        -- Find traffic usage
@@ -410,7 +409,7 @@ function list()
                if s[".type"] == "lease" and s.mac then
                        local ti, to = traffic(s)
                        local mac = s.mac:lower()
-                       local arp = arpcache[mac]:lower()
+                       local arp = arpcache[mac]
                        print(string.format(
                                "%-17s  %-15s  %-9s  %3dm  %-7s  %7dKB  %7dKB",
                                mac, s.ipaddr, "leased",
@@ -429,8 +428,8 @@ function list()
                        local arp = arpcache[mac]
                        print(string.format(
                                "%-17s  %-15s  %-9s  %4s  %-7s  %9s  %9s",
-                               mac, arp and arp[2]:lower() or "?", s[".type"],
-                               "- ", arp and arp[1]:lower() or "?", "-", "-"
+                               mac, arp and arp[2] or "?", s[".type"],
+                               "- ", arp and arp[1] or "?", "-", "-"
                        ))
                end
        end