+++ /dev/null
-#!/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
-}
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.
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",
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(