$(INSTALL_BIN) ./dist/usr/bin/run-parts $(1)/usr/bin
$(INSTALL_BIN) ./dist/sbin/luci-flash $(1)/sbin
- $(INSTALL_BIN) ./dist/etc/init.d/luci-fixtime $(1)/etc/init.d
-
+ $(INSTALL_BIN) ./dist/etc/init.d/luci_fixtime $(1)/etc/init.d
+ $(INSTALL_BIN) ./dist/etc/init.d/luci_ethers $(1)/etc/init.d
+
$(CP) ./dist/etc/crontabs/root $(1)/etc/crontabs/root
$(CP) ./dist/etc/hotplug.d/iface/20-aliases $(1)/etc/hotplug.d/iface/20-aliases
endef
+++ /dev/null
-#!/bin/sh /etc/rc.common
-
-START=05
-
-start() {
- cat <<' EOF' | lua -l luci.fs -l luci.sys -
- if (os.time() < 1000000000) then
- os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
- end
- EOF
-}
--- /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
+ test -d /var/etc || mkdir -p /var/etc
+ ln -s /var/etc/ethers /etc/ethers
+ fi
+
+ config_load luci_ethers
+ config_foreach apply_lease static_lease
+
+ test -f /etc/ethers.local && cat /etc/ethers.local >> /var/etc/ethers
+}
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=05
+
+start() {
+ cat <<' EOF' | lua -l luci.fs -l luci.sys -
+ if (os.time() < 1000000000) then
+ os.execute('date -s ' .. os.date('%m%d%H%M%Y', luci.fs.mtime(luci.sys.libpath())))
+ end
+ EOF
+}