[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Hostname



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... 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]