summaryrefslogtreecommitdiffstats
path: root/main/openrc/hostname.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/openrc/hostname.initd')
-rw-r--r--main/openrc/hostname.initd18
1 files changed, 18 insertions, 0 deletions
diff --git a/main/openrc/hostname.initd b/main/openrc/hostname.initd
new file mode 100644
index 00000000..995e4b95
--- /dev/null
+++ b/main/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 $?
+}