mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-20 09:39:08 +00:00
add missing hostname file
Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
parent
366973ea80
commit
f8254ea4dd
21
alpine/packages/hostname/etc/init.d/hostname
Executable file
21
alpine/packages/hostname/etc/init.d/hostname
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
description="Sets the hostname of the machine."
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
after 9pinit
|
||||||
|
keyword -prefix -lxc
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
opts="docker"
|
||||||
|
if cat /proc/cmdline | grep -q 'com.docker.database'
|
||||||
|
then
|
||||||
|
DATABASE="/Mac$(cat /proc/cmdline | sed -e 's/.*com.docker.database="//' -e 's/".*//')"
|
||||||
|
HOSTFILE="/Database/branch/master/ro/${DATABASE}/hostname"
|
||||||
|
[ -s ${HOSTFILE} ] && opts="-F ${HOSTFILE}"
|
||||||
|
fi
|
||||||
|
ebegin "Setting hostname"
|
||||||
|
hostname $opts
|
||||||
|
eend $?
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user