2010-04-20 12:58:29 +00:00
|
|
|
description "Setup System Hostname"
|
|
|
|
author "Harald Kueller <harald.kueller@compuextreme.de>"
|
|
|
|
version 1.0
|
|
|
|
emits none special
|
2008-05-03 17:03:02 +00:00
|
|
|
|
2010-04-20 12:58:29 +00:00
|
|
|
start on ( runlevel [S012345] and ( started udev ))
|
2008-05-03 17:03:02 +00:00
|
|
|
|
2010-04-20 12:58:29 +00:00
|
|
|
console none
|
2008-05-03 17:03:02 +00:00
|
|
|
script
|
2010-04-20 12:58:29 +00:00
|
|
|
echo "setting up hostname"
|
|
|
|
source /etc/init/functions
|
2008-05-03 17:03:02 +00:00
|
|
|
if [ -f /etc/sysconfig/nodename ]; then
|
|
|
|
/bin/hostname `cat /etc/sysconfig/nodename`
|
2010-01-28 13:58:15 +00:00
|
|
|
status_message "Hostname set to $HOSTNAME"
|
2008-05-03 17:03:02 +00:00
|
|
|
else
|
|
|
|
/bin/hostname "localhost"
|
2010-01-28 13:58:15 +00:00
|
|
|
status_message "Hostname set to $HOSTNAME"
|
2008-05-03 17:03:02 +00:00
|
|
|
fi
|
|
|
|
end script
|