X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=local%2Fnetwork-configure;h=05d6034e7550c8603a8aac8d13d7958bf7a4c80d;hp=5b412c6308ad5c9613a10e794e9f3eb504155ac2;hb=b75d4503ef9c919231c0c02daf5a1ed1e57c73af;hpb=0d705d8e2a919ee40866307aa3e18b1a5c4e7583 diff --git a/local/network-configure b/local/network-configure index 5b412c6..05d6034 100755 --- a/local/network-configure +++ b/local/network-configure @@ -6,16 +6,20 @@ sudo install -m 644 -o root -g root /dev/stdin \ /etc/hostname <<-EOF $vm EOF -grep -q " $vm\$" /etc/hosts || + { + printf '%s\n' "$(cat /etc/hosts)" + grep -q " $vm\$" /etc/hosts || + printf "%s\n" "127.0.0.1 $local_fqdn $vm" + grep -q " postgresql.$local_domainname\$" /etc/hosts || + printf "%s\n" "127.0.0.1 postgresql.$local_domainname" + } | sudo install -m 644 -o root -g root /dev/stdin \ - /etc/hosts <<-EOF - $(cat /etc/hosts) - 127.0.0.1 $local_fqdn $vm - EOF + /etc/hosts sudo install -m 644 -o root -g root /dev/stdin \ /etc/resolv.conf <<-EOF search ${local_host#*.} - nameserver ${local_host_nameserver} + nameserver 127.0.0.1 + #nameserver ${local_host_nameserver} EOF m4 \ --define=LOCAL_IPV4=$local_ipv4 \