diff options
Diffstat (limited to 'core/openrc/hostname.initd')
-rw-r--r-- | core/openrc/hostname.initd | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/openrc/hostname.initd b/core/openrc/hostname.initd new file mode 100644 index 0000000000..995e4b95d8 --- /dev/null +++ b/core/openrc/hostname.initd @@ -0,0 +1,18 @@ +#!/sbin/runscript + +description="Sets the hostname of the machine." + +depend() { + keyword noprefix +} + +start() { + if [ -f /etc/hostname ] ; then + opts="-F /etc/hostname" + else + opts="localhost" + fi + ebegin "Setting hostname" + hostname $opts + eend $? +} |