mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
Merge pull request #1365 from t-woerner/infra_image_start_hosts_safer_removal
infra/image/shcontainer: Safer host removal from /etc/hosts
This commit is contained in:
@@ -60,7 +60,7 @@ container_start() {
|
||||
hostname=$(podman inspect "${name}" --format "{{.Config.Hostname}}")
|
||||
if [ -n "${ip}" ] && [ -n "${hostname}" ]; then
|
||||
cmd=$(cat <<EOF
|
||||
sed -i -e "/[ \t]${hostname}/d" /etc/hosts
|
||||
sed -i -E "/\s+${hostname}(\s|$)/d" /etc/hosts
|
||||
echo -e "$ip\t${hostname} ${hostname%%.*}" >> /etc/hosts
|
||||
EOF
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user