diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-01-28 18:17:41 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-01-28 18:17:41 +0000 |
commit | 4b62df0945d1eb7a9f95ff8b4678e07b91480e8a (patch) | |
tree | 9764964703dbc79dc0a4c7375d8b381cc2194a47 | |
parent | 515ac3e6fe29aeb85c9d777d90f123d3ff34556b (diff) |
modules/admin-core: add autogeneartion notice to /var/etc/hosts, /var/etc/ethers
-rwxr-xr-x | modules/admin-core/root/etc/init.d/luci_ethers | 12 | ||||
-rwxr-xr-x | modules/admin-core/root/etc/init.d/luci_hosts | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/modules/admin-core/root/etc/init.d/luci_ethers b/modules/admin-core/root/etc/init.d/luci_ethers index 8cf46729d..fb1deb2d4 100755 --- a/modules/admin-core/root/etc/init.d/luci_ethers +++ b/modules/admin-core/root/etc/init.d/luci_ethers @@ -8,7 +8,7 @@ apply_lease() { config_get ipaddr "$cfg" ipaddr [ -n "$macaddr" -a -n "$ipaddr" ] || return 0 - + echo "$macaddr $ipaddr" >> /var/etc/ethers } @@ -19,17 +19,19 @@ start() { 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-core/root/etc/init.d/luci_hosts b/modules/admin-core/root/etc/init.d/luci_hosts index 3c1034a6e..ae94714ef 100755 --- a/modules/admin-core/root/etc/init.d/luci_hosts +++ b/modules/admin-core/root/etc/init.d/luci_hosts @@ -18,6 +18,8 @@ start() { 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 |