William C Bonner a écrit :
Is there an easy way of auto generating a hostname at boot time?


Is there a way of having a hostname auto generted at boot time, possibly
based on an available network address.

e.g.

hostname not on the network: beagleboard
hostname on the network: beagleboard-00259C642A2C

Getting the hostname suffix from the ethernet0 HWaddr.
Try :

ethaddr=`cat /sys/class/net/eth0/address | sed s/\://g`
hostname="beagleboard-$ethaddr"

Of course you need to have sysfs mounted before doing this.

Regards,

_______________________________________________
Angstrom-distro-users mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-users

Reply via email to