X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=local%2Fnetwork-configure;h=be3e4b4634eba8d750d005ce535a40d13ab45c67;hp=5b412c6308ad5c9613a10e794e9f3eb504155ac2;hb=f5e12fec2c7ef8d743e2d3e32c3bbe37b40c7a73;hpb=6647e7fb851e2dbe5a5c7ec60358f7371bf17183 diff --git a/local/network-configure b/local/network-configure index 5b412c6..be3e4b4 100755 --- a/local/network-configure +++ b/local/network-configure @@ -6,12 +6,15 @@ 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#*.}