17 lines
664 B
Bash
Executable File
17 lines
664 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# $1 Container id
|
|
# $2 Container name.
|
|
# $3 Section (always 'lxc').
|
|
# $4 The hook type (i.e. 'clone' or 'pre-mount').
|
|
|
|
# following environment variables are set by lxc :
|
|
# $LXC_NAME: is the container's name.
|
|
# $LXC_ROOTFS_MOUNT: the path to the mounted root filesystem.
|
|
# $LXC_CONFIG_FILE: the path to the container configuration file.
|
|
# $LXC_SRC_NAME: in the case of the clone hook, this is the original container's name.
|
|
# $LXC_ROOTFS_PATH: this is the lxc.rootfs entry for the container.
|
|
# Note this is likely not where the mounted rootfs is to be found, use LXC_ROOTFS_MOUNT for that.
|
|
|
|
echo $HNAME > $LXC_ROOTFS_PATH/etc/hostname
|