/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#*.}