2010-04-22 14:04:34 +00:00
|
|
|
description "Setup System Hostname"
|
|
|
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|
|
|
version 1.0
|
|
|
|
emits none special
|
|
|
|
|
2010-06-23 10:16:49 +00:00
|
|
|
start on ( runlevel [012345] and ( started udev ))
|
2010-04-22 14:04:34 +00:00
|
|
|
|
|
|
|
console none
|
|
|
|
script
|
|
|
|
if ip addr list dev eth0|grep -q inet; then
|
|
|
|
IP=`ifconfig eth0|grep inet|awk '{print $2}'|cut -d ":" -f 2`
|
|
|
|
echo "$IP ViitorLinux_install" >>/etc/hosts
|
|
|
|
else
|
|
|
|
sed -e "s/127\.0\.0\.1.*$/127.0.0.1 localhost ViitorLinux_install/" /etc/hosts >/tmp/hosts
|
|
|
|
mv /tmp/hosts /var/etc/hosts
|
|
|
|
fi
|
2010-05-01 11:42:39 +00:00
|
|
|
hostname ViitorInstall
|
2010-04-22 14:04:34 +00:00
|
|
|
end script
|