From 773e6b78c3a5a89780bd3f9a5ebb2ac78b3cf408 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 8 Mar 2010 01:07:02 +0000 Subject: [PATCH] luci-0.9: drop luci_ethers, static lease mgmnt. is now covered by /etc/config/dhcp --- .../admin-core/root/etc/config/luci_ethers | 1 - .../admin-core/root/etc/init.d/luci_ethers | 37 ------------------- .../model/cbi/admin_network/dhcpleases.lua | 10 +++-- 3 files changed, 6 insertions(+), 42 deletions(-) delete mode 100644 modules/admin-core/root/etc/config/luci_ethers delete mode 100755 modules/admin-core/root/etc/init.d/luci_ethers diff --git a/modules/admin-core/root/etc/config/luci_ethers b/modules/admin-core/root/etc/config/luci_ethers deleted file mode 100644 index 8b1378917..000000000 --- a/modules/admin-core/root/etc/config/luci_ethers +++ /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 index fb1deb2d4..000000000 --- a/modules/admin-core/root/etc/init.d/luci_ethers +++ /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 -} diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua b/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua index 31a27b3f6..db470824c 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/dhcpleases.lua @@ -2,6 +2,7 @@ LuCI - Lua Configuration Interface Copyright 2008 Steven Barth +Copyright 2010 Jo-Philipp Wich 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( -- 2.25.1