mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-06 09:21:28 +00:00
add missing hostname file
Signed-off-by: Justin Cormack <justin.cormack@unikernel.com>
This commit is contained in:
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 $?
|
||||||
|
}
|
Reference in New Issue
Block a user