--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- a/vz/dists/scripts/functions +++ b/vz/dists/scripts/functions @@ -272,15 +272,16 @@ change_hostname() ${CP} "$cfg" "$cfg.$$" || error "Can't copy file ${cfg}" $VZ_FS_NO_DISK_SPACE awk -v ip="$ip" -v host="$host" -v comm="$comm" ' - BEGIN {found = 0; skip = 0} + BEGIN {found = 0; skip = 0; lcl=0} $0 == comm {found = 1; next} found { if (ip == "") {ip = $1} next; } - !found && $2 == host {skip = 1} - $1 == "127.0.0.1" { + $2 == host {skip = 1} + !lcl && $1 == "127.0.0.1" { print "127.0.0.1 localhost.localdomain localhost"; + lcl = 1; next; } {print}