From d3083a9e7a8896e670916e12b3347cf08103b559 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 8 Mar 2010 01:19:46 +0000 Subject: [PATCH] luci-0.9: merge r5744 --- modules/admin-core/root/etc/config/luci_hosts | 1 - modules/admin-core/root/etc/init.d/luci_hosts | 36 ------------------- .../luasrc/model/cbi/admin_network/hosts.lua | 8 ++--- 3 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 modules/admin-core/root/etc/config/luci_hosts delete mode 100755 modules/admin-core/root/etc/init.d/luci_hosts 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 8b1378917..000000000 --- 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_hosts b/modules/admin-core/root/etc/init.d/luci_hosts deleted file mode 100755 index ae94714ef..000000000 --- a/modules/admin-core/root/etc/init.d/luci_hosts +++ /dev/null @@ -1,36 +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_foreach apply_host host - - 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 dbf4aff90..3570a1bc7 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/hosts.lua @@ -14,15 +14,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("hostnames_entries")) +s = m:section(TypedSection, "domain", translate("hostnames_entries")) s.addremove = true s.anonymous = true s.template = "cbi/tblsection" -hn = s:option(Value, "hostname", translate("hostnames_hostname")) -ip = s:option(Value, "ipaddr", translate("hostnames_address")) +hn = s:option(Value, "name", translate("hostnames_hostname")) +ip = s:option(Value, "ip", translate("hostnames_address")) for i, dataset in ipairs(luci.sys.net.arptable()) do ip:value( dataset["IP address"], -- 2.25.1