diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-02-20 21:20:18 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-02-20 21:20:18 -0600 |
commit | 866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 (patch) | |
tree | 4bce7ccd2a7603bdf638e250b8e30e54c1dea909 /system/openrc/hostname.initd | |
parent | 31f3497a1ca9637ff42f3185a5924e0f4e61ab5d (diff) | |
download | packages-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.initd | 18 |
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 $? +} |