[102019] in RedHat Linux List
Re: Hostname
daemon@ATHENA.MIT.EDU (Priyadi Iman Nurcahyo)
Mon Nov 30 23:05:48 1998
Date: Tue, 1 Dec 1998 10:55:03 +0700
From: Priyadi Iman Nurcahyo <priyadi@priyadi.ml.org>
To: redhat-list@redhat.com
In-Reply-To: <366351C6.B5547DE0@nbnet.nb.ca>; from Michael Butler on Mon, Nov 30, 1998 at 10:17:42PM -0400
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
On Mon, Nov 30, 1998 at 10:17:42PM -0400, Michael Butler wrote:
> Hello All,
> I want to change my hostname, which I can do. My problem is that I am running
> a database product that relies on the use of my old hostname to connect to my
> databases.
>
> My previous hostname was localhost.localdomain and I've successfully changed
> the name to euclid.net. Is there a way that I can have localhost.localdomain
> recognized as well so that I can connect to the database?
if you're lucky, you can just replace every occurence of 'localhost.localdomain'
in your filesystem to 'euclid.net' (and maybe the corresponding ip address as well)
it did the trick when i move my development machine into production...
#!/bin/sh
for A in `find / -type f`
do
if ((grep "localhost\.localdomain" $A > /dev/null) && (file $A | grep "ASCII" > /dev/null))
then
echo $A
sed s/localhost\.localdomain/eudlid.net/g < $A > $A.tmp2
mv $A $A.tmp
mv $A.tmp2 $A
fi
done
the above script should replace every 'localhost.localdomain' in every text file
in your filesystem to 'euclid.net'...
as usual, don't forget to backup first...
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.