debian: fix initialization of /etc/hosts

This commit is contained in:
Marek Marczykowski-Górecki 2014-11-05 05:10:42 +01:00
parent 36b1793739
commit a2bba58877

2
debian/postinst vendored
View File

@ -112,7 +112,7 @@ case "$1" in
sed -i "/^${ip}\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts sed -i "/^${ip}\s/,+0s/\(\s`hostname`\)\+\(\s\|$\)/\2/g" /etc/hosts
sed -i "s/^${ip}\(\s\|$\).*$/\0 `hostname`/" /etc/hosts sed -i "s/^${ip}\(\s\|$\).*$/\0 `hostname`/" /etc/hosts
else else
echo "${ip} `hostname`" >> /etc/hosts echo "${ip//\\/} `hostname`" >> /etc/hosts
fi fi
done done
# remove hostname from 127.0.0.1 line (in debian the hostname is by default # remove hostname from 127.0.0.1 line (in debian the hostname is by default