LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


Hello,

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

%post

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

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


Please Help!
 
Old 03-08-2010, 01:43 PM   #2
jamescondron
Member
 
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
 
  


Reply


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 01:18 PM
DHCP seems to set hostname = Mac address, doesn't reverse lookup techsimian Linux - Networking 4 08-15-2006 05:11 PM
Automatic Hostname Resolution douceur Linux - Networking 3 06-21-2005 05:50 AM
MAC Address based hostname hogg85 Linux - Networking 2 06-13-2005 01:51 PM
Automatic hostname in Redhat 9 twood Linux - Networking 3 06-05-2003 05:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:55 PM.

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