mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-17 03:19:22 +00:00
If no hostname is set, use mac address to generate one.
Currently not working very well in hyperkit due to https://github.com/docker/vpnkit/issues/190 Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
@@ -83,7 +83,16 @@ done
|
||||
mdev -s
|
||||
|
||||
# set hostname
|
||||
[ -s /etc/hostname ] && hostname -F /etc/hostname
|
||||
if [ -s /etc/hostname ]
|
||||
then
|
||||
hostname -F /etc/hostname
|
||||
fi
|
||||
|
||||
if [ $(hostname) = "moby" -a -f /sys/class/net/eth0/address ]
|
||||
then
|
||||
mac=$(cat /sys/class/net/eth0/address)
|
||||
hostname moby-$(echo $mac | sed 's/://g')
|
||||
fi
|
||||
|
||||
# set system clock from hwclock
|
||||
hwclock --hctosys --utc
|
||||
|
||||
Reference in New Issue
Block a user