X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=local%2Fnetwork-configure;h=e349a7bd524af9ce1aed5ab440dcaa41cd98ff7f;hp=d70b6ffc9dd33eabcd03f0ece9ba81f0c44e7caa;hb=c192234993ad164de7d43cae78e4332185e91a24;hpb=3ad6118386977e346d81042e924e5db9c5f15b7d diff --git a/local/network-configure b/local/network-configure index d70b6ff..e349a7b 100755 --- a/local/network-configure +++ b/local/network-configure @@ -6,19 +6,25 @@ 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 $vm_fqdn $vm - EOF + /etc/hosts sudo install -m 644 -o root -g root /dev/stdin \ /etc/resolv.conf <<-EOF - search ${vm_host#*.} - nameserver ${vm_host_nameserver} + search ${local_host#*.} + nameserver 127.0.0.1 + #nameserver ${local_host_nameserver} EOF m4 \ - --define=VM_IPV4=$vm_ipv4 \ + --define=LOCAL_IPV4=$local_ipv4 \ + --define=LOCAL_GATEWAY=$local_gateway \ + --define=LOCAL_NETMASK=$local_netmask \ <"$tool"/etc/network/interfaces.m4 | sudo install -m 640 -o root -g root /dev/stdin \ /etc/network/interfaces