1 #!/bin/sh /etc/rc.common
7 config_get macaddr
"$cfg" macaddr
8 config_get ipaddr
"$cfg" ipaddr
10 [ -n "$macaddr" -a -n "$ipaddr" ] ||
return 0
12 echo "$macaddr $ipaddr" >> /var
/etc
/ethers
16 if [ ! -L /etc
/ethers
]; then
17 test -f /etc
/ethers
&& mv /etc
/ethers
/etc
/ethers.
local
18 ln -s /var
/etc
/ethers
/etc
/ethers
21 test -d /var
/etc || mkdir
-p /var
/etc
23 echo "# This file is autogenerated, use /etc/ethers.local instead" > /var
/etc
/ethers
25 config_load luci_ethers
26 config_load luci_etherhosts
27 config_foreach apply_lease static_lease
28 config_foreach apply_lease entry
30 test -f /etc
/ethers.
local && cat /etc
/ethers.
local >> /var
/etc
/ethers
36 test -f /var
/etc
/ethers
&& rm -f /var
/etc
/ethers