From d28d2287b138ede0591d9facd5dbe7ca4f329f83 Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 29 Mar 2022 23:37:34 +0100 Subject: added sysvinit and openrc --- extra/openrc/hostname.initd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 extra/openrc/hostname.initd (limited to 'extra/openrc/hostname.initd') diff --git a/extra/openrc/hostname.initd b/extra/openrc/hostname.initd new file mode 100644 index 0000000..bd20874 --- /dev/null +++ b/extra/openrc/hostname.initd @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +description="Sets the hostname of the machine." + +depend() { + keyword -prefix -lxc -docker +} + +start() { + if [ -s /etc/hostname ] ; then + opts="-F /etc/hostname" + else + opts="${hostname:-localhost}" + fi + ebegin "Setting hostname" + hostname $opts + eend $? +} -- cgit v1.2.1