modules/admin-core: add autogeneartion notice to /var/etc/hosts, /var/etc/ethers
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 28 Jan 2009 18:17:41 +0000 (18:17 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 28 Jan 2009 18:17:41 +0000 (18:17 +0000)
modules/admin-core/root/etc/init.d/luci_ethers
modules/admin-core/root/etc/init.d/luci_hosts

index 8cf46729dfea78d6ec3ea2c28eb661b043ece0d9..fb1deb2d41eb7fe027ab975370f5829bace043b7 100755 (executable)
@@ -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
 }
index 3c1034a6e303a762d66a025a25a8ce5a629f3848..ae94714effee63858de9394ed4162ab048ff06a1 100755 (executable)
@@ -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