* luci/modules/admin-core: make sure luci_hosts is executed before dnsmasq
This commit is contained in:
parent
4538b12895
commit
30c7933f23
1 changed files with 5 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
START=60
|
START=59
|
||||||
|
|
||||||
apply_host() {
|
apply_host() {
|
||||||
local cfg="$1"
|
local cfg="$1"
|
||||||
|
@ -8,7 +8,7 @@ apply_host() {
|
||||||
config_get ipaddr "$cfg" ipaddr
|
config_get ipaddr "$cfg" ipaddr
|
||||||
|
|
||||||
[ -n "$hostname" -a -n "$ipaddr" ] || return 0
|
[ -n "$hostname" -a -n "$ipaddr" ] || return 0
|
||||||
|
|
||||||
echo "$ipaddr $hostname" >> /var/etc/hosts
|
echo "$ipaddr $hostname" >> /var/etc/hosts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,15 +20,15 @@ start() {
|
||||||
|
|
||||||
test -d /var/etc || mkdir -p /var/etc
|
test -d /var/etc || mkdir -p /var/etc
|
||||||
test -f /etc/hosts.local && cat /etc/hosts.local >> /var/etc/hosts
|
test -f /etc/hosts.local && cat /etc/hosts.local >> /var/etc/hosts
|
||||||
|
|
||||||
config_load luci_hosts
|
config_load luci_hosts
|
||||||
config_foreach apply_host host
|
config_foreach apply_host host
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
test -f /var/etc/hosts && rm -f /var/etc/hosts
|
test -f /var/etc/hosts && rm -f /var/etc/hosts
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue