File: clonehostname

package info (click to toggle)
lxc 1%3A6.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,808 kB
  • sloc: ansic: 68,840; sh: 4,266; python: 135; makefile: 59
file content (18 lines) | stat: -rwxr-xr-x 417 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh
#
# SPDX-License-Identifier: GPL-2.0-only
#
# Update the hostname in the cloned container's scripts

# Note that /etc/hostname is updated by lxc itself
for file in \
    $LXC_ROOTFS_MOUNT/etc/sysconfig/network \
    $LXC_ROOTFS_MOUNT/etc/sysconfig/network-scripts/ifcfg-* \
    $LXC_ROOTFS_MOUNT/etc/hosts ;
do
    if [ -f $file ]; then
        sed -i "s|$LXC_SRC_NAME|$LXC_NAME|" $file
    fi
done

exit 0