mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-13 04:22:58 +02:00
setup: Write /etc/hosts in initscript
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -22,6 +22,18 @@ write_resolv_conf() {
|
||||
) > /etc/resolv.conf
|
||||
}
|
||||
|
||||
write_hosts() {
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
|
||||
|
||||
(
|
||||
echo "127.0.0.1 localhost.localdomain localhost"
|
||||
|
||||
if [ -n "${GREEN_ADDRESS}" ]; then
|
||||
echo "${GREEN_ADDRESS} ${HOSTNAME}.${DOMAINNAME} ${HOSTNAME}"
|
||||
fi
|
||||
) > /etc/hosts
|
||||
}
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
|
||||
@@ -40,6 +52,9 @@ case "${1}" in
|
||||
evaluate_retval
|
||||
fi
|
||||
|
||||
# Update hosts
|
||||
write_hosts
|
||||
|
||||
# Update resolv.conf
|
||||
write_resolv_conf
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user