Re: changing my hostname?

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

 



Kevin Kempter wrote:
Hi List;

Where do I change the hostname for a machine running Fedora 7?


---cut---
#!/bin/sh

user=`id -u`

if [ $user != 0 ]
       then
       echo "Must be root to execute:  $0"
       exit
fi

HOST=`hostname`

echo -n "Enter the new Host Name:  "
read garb

echo "g/${HOST}/s//${garb}/g
w
q
" > /tmp/doed

list="/etc/hosts /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth?"

for name in $list
do
       echo "editing $name"
       ed $name < /tmp/doed
       hostname $garb
done
---cut---


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux