mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-03 21:21:39 +00:00
Don't update the host-name field in dhclient.conf when not hardcoded.
On Debian and Ubuntu, the default host-name field in dhclient.conf is set to either "<hostname>" or "gethostname()" both of which get replaced by the machine's hostname at query time. The sed call currently present in lxc-clone hardcodes the hostname in dhclient.conf, causing dpkg to prompt on isc-dhcp updates. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
e470cba076
commit
33f3de4eaa
@ -265,7 +265,7 @@ fi
|
||||
echo "Updating rootfs..."
|
||||
|
||||
# so you can 'ssh $hostname.' or 'ssh $hostname.local'
|
||||
if [ -f $rootfs/etc/dhcp/dhclient.conf ]; then
|
||||
if [ -f $rootfs/etc/dhcp/dhclient.conf ] && ! grep -q "^send host-name.*hostname" $rootfs/etc/dhcp/dhclient.conf; then
|
||||
sed -i "s/send host-name.*$/send host-name \"$hostname\";/" $rootfs/etc/dhcp/dhclient.conf
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user