luci-0.9: drop luci_ethers, static lease mgmnt. is now covered by /etc/config/dhcp
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 8 Mar 2010 01:07:02 +0000 (01:07 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 8 Mar 2010 01:07:02 +0000 (01:07 +0000)
modules/admin-core/root/etc/config/luci_ethers [deleted file]
modules/admin-core/root/etc/init.d/luci_ethers [deleted file]
modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua

diff --git a/modules/admin-core/root/etc/config/luci_ethers b/modules/admin-core/root/etc/config/luci_ethers
deleted file mode 100644 (file)
index 8b13789..0000000
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/modules/admin-core/root/etc/init.d/luci_ethers b/modules/admin-core/root/etc/init.d/luci_ethers
deleted file mode 100755 (executable)
index fb1deb2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh /etc/rc.common
-START=59
-
-apply_lease() {
-       local cfg="$1"
-
-       config_get macaddr "$cfg" macaddr
-       config_get ipaddr  "$cfg" ipaddr
-
-       [ -n "$macaddr" -a -n "$ipaddr" ] || return 0
-
-       echo "$macaddr $ipaddr" >> /var/etc/ethers
-}
-
-start() {
-       if [ ! -L /etc/ethers ]; then
-               test -f /etc/ethers && mv /etc/ethers /etc/ethers.local
-               ln -s /var/etc/ethers /etc/ethers
-       fi
-
-       test -d /var/etc || mkdir -p /var/etc
-
-       echo "# This file is autogenerated, use /etc/ethers.local instead" > /var/etc/ethers
-
-       config_load luci_ethers
-       config_foreach apply_lease static_lease
-
-       test -f /etc/ethers.local && cat /etc/ethers.local >> /var/etc/ethers
-
-       return 0
-}
-
-stop() {
-       test -f /var/etc/ethers && rm -f /var/etc/ethers
-
-       return 0
-}
index 31a27b3..db47082 100644 (file)
@@ -2,6 +2,7 @@
 LuCI - Lua Configuration Interface
 
 Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
@@ -17,7 +18,7 @@ local sys = require "luci.sys"
 local wa  = require "luci.tools.webadmin"
 local fs  = require "nixio.fs"
 
-m2 = Map("luci_ethers", translate("dhcp_leases"))
+m2 = Map("dhcp", translate("dhcp_leases"))
 
 local leasefn, leasefp, leases
 uci:foreach("dhcp", "dnsmasq",
@@ -46,13 +47,14 @@ if leases then
        end
 end
 
-s = m2:section(TypedSection, "static_lease", translate("luci_ethers"))
+s = m2:section(TypedSection, "host", translate("luci_ethers"))
 s.addremove = true
 s.anonymous = true
 s.template = "cbi/tblsection"
 
-mac = s:option(Value, "macaddr", translate("macaddress"))
-ip = s:option(Value, "ipaddr", translate("ipaddress"))
+name = s:option(Value, "name", translate("hostname"))
+mac = s:option(Value, "mac", translate("macaddress"))
+ip = s:option(Value, "ip", translate("ipaddress"))
 sys.net.arptable(function(entry)
        ip:value(entry["IP address"])
        mac:value(