diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/admin-core/root/etc/config/luci_etherhosts | 0 | ||||
-rw-r--r-- | modules/admin-core/root/etc/config/luci_ethers | 1 | ||||
-rw-r--r-- | modules/admin-core/root/etc/config/luci_hosts | 1 | ||||
-rwxr-xr-x | modules/admin-core/root/etc/init.d/luci_ethers | 39 | ||||
-rwxr-xr-x | modules/admin-core/root/etc/init.d/luci_hosts | 38 | ||||
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua | 9 |
6 files changed, 5 insertions, 83 deletions
diff --git a/modules/admin-core/root/etc/config/luci_etherhosts b/modules/admin-core/root/etc/config/luci_etherhosts deleted file mode 100644 index e69de29bb2..0000000000 --- a/modules/admin-core/root/etc/config/luci_etherhosts +++ /dev/null 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 8b13789179..0000000000 --- a/modules/admin-core/root/etc/config/luci_ethers +++ /dev/null @@ -1 +0,0 @@ - diff --git a/modules/admin-core/root/etc/config/luci_hosts b/modules/admin-core/root/etc/config/luci_hosts deleted file mode 100644 index 8b13789179..0000000000 --- a/modules/admin-core/root/etc/config/luci_hosts +++ /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 188c01cc2d..0000000000 --- a/modules/admin-core/root/etc/init.d/luci_ethers +++ /dev/null @@ -1,39 +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_load luci_etherhosts - config_foreach apply_lease static_lease - config_foreach apply_lease entry - - 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-core/root/etc/init.d/luci_hosts b/modules/admin-core/root/etc/init.d/luci_hosts deleted file mode 100755 index 8b8305da76..0000000000 --- a/modules/admin-core/root/etc/init.d/luci_hosts +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh /etc/rc.common -START=59 - -apply_host() { - local cfg="$1" - - config_get hostname "$cfg" hostname - config_get ipaddr "$cfg" ipaddr - - [ -n "$hostname" -a -n "$ipaddr" ] || return 0 - - echo "$ipaddr $hostname" >> /var/etc/hosts -} - -start() { - if [ ! -L /etc/hosts ]; then - test -f /etc/hosts && mv /etc/hosts /etc/hosts.local - ln -s /var/etc/hosts /etc/hosts - fi - - echo "# This file is autogenerated, use /etc/hosts.local instead" > /var/etc/hosts - - test -d /var/etc || mkdir -p /var/etc - test -f /etc/hosts.local && cat /etc/hosts.local >> /var/etc/hosts - - config_load luci_hosts - config_load luci_etherhosts - config_foreach apply_host host - config_foreach apply_host entry - - return 0 -} - -stop() { - test -f /var/etc/hosts && rm -f /var/etc/hosts - - return 0 -} diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua b/modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua index 58c10db41e..fa8b217de4 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua @@ -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. @@ -14,15 +15,15 @@ $Id$ require("luci.sys") require("luci.util") -m = Map("luci_hosts", translate("Hostnames")) +m = Map("dhcp", translate("Hostnames")) -s = m:section(TypedSection, "host", translate("Host entries")) +s = m:section(TypedSection, "domain", translate("Host entries")) s.addremove = true s.anonymous = true s.template = "cbi/tblsection" -hn = s:option(Value, "hostname", translate("Hostname")) -ip = s:option(Value, "ipaddr", translate("IP address")) +hn = s:option(Value, "name", translate("Hostname")) +ip = s:option(Value, "ip", translate("IP address")) for i, dataset in ipairs(luci.sys.net.arptable()) do ip:value( dataset["IP address"], |