summaryrefslogtreecommitdiff
path: root/system/openrc/hostname.initd
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:20:18 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-20 21:20:18 -0600
commit866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 (patch)
tree4bce7ccd2a7603bdf638e250b8e30e54c1dea909 /system/openrc/hostname.initd
parent31f3497a1ca9637ff42f3185a5924e0f4e61ab5d (diff)
downloadpackages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.gz
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.bz2
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.xz
packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.zip
system/openrc: migrate from aports fork
Diffstat (limited to 'system/openrc/hostname.initd')
-rw-r--r--system/openrc/hostname.initd18
1 files changed, 18 insertions, 0 deletions
diff --git a/system/openrc/hostname.initd b/system/openrc/hostname.initd
new file mode 100644
index 000000000..c1580db08
--- /dev/null
+++ b/system/openrc/hostname.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+description="Sets the hostname of the machine."
+
+depend() {
+ keyword -prefix -lxc
+}
+
+start() {
+ if [ -s /etc/hostname ] ; then
+ opts="-F /etc/hostname"
+ else
+ opts="localhost"
+ fi
+ ebegin "Setting hostname"
+ hostname $opts
+ eend $?
+}