Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-07-2010, 02:41 PM   #1
LQ Newbie
Registered: Feb 2010
Posts: 3

Rep: Reputation: 0
Postscript for automatic USB installation (MAC address for Hostname)


I am looking for help on how to make my bootable USB drive to automatically change the hostname to the MAC address of the system.

i know that i am suppose to add some scripts under the postscipt portion of the kickstart file and this is what i have so far and is not working.

I also know for sure that the first script below works because when i echo it on linux mechine it gives me the MAC address the way i want. However there is more i need to do so that wherever the installation is the hostname automatically becomes the MAC address


HOSTNAME=(`/sbin/ifconfig eth0 |grep HWaddr |cut -d ' ' -f11 |sed 's/://g'`)

echo HOSTNAME=$HOSTNAME >> /etc/sysconfig/network
echo NETWORKING=yes > /etc/sysconfig/network

Please Help!
Old 03-08-2010, 12:43 PM   #2
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Take a look at runlevels and the man page for 'hostname';

If I understand you, you just want to use the hostname command to set it to $HOSTNAME, and you want to run it at boot.

As a jumping off point, the file you'll want to look at is rc.local; I forget the path, but you'll find it


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic installation using preseeding: Changing MAC-address SeppJ Ubuntu 0 06-10-2009 12:18 PM
DHCP seems to set hostname = Mac address, doesn't reverse lookup techsimian Linux - Networking 4 08-15-2006 04:11 PM
Automatic Hostname Resolution douceur Linux - Networking 3 06-21-2005 04:50 AM
MAC Address based hostname hogg85 Linux - Networking 2 06-13-2005 12:51 PM
Automatic hostname in Redhat 9 twood Linux - Networking 3 06-05-2003 04:03 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration