Lines 275-281
change_hostname()
Link Here
|
275 |
BEGIN {found = 0; skip = 0} |
275 |
BEGIN {found = 0; skip = 0} |
276 |
$0 == comm {found = 1; next} |
276 |
$0 == comm {found = 1; next} |
277 |
found { |
277 |
found { |
278 |
if (ip == "") {ip = $1} |
278 |
if (ip == "" && ! $1 ~ "^#") {ip = $1} |
279 |
next; |
279 |
next; |
280 |
} |
280 |
} |
281 |
!found && $2 == host {skip = 1} |
281 |
!found && $2 == host {skip = 1} |
Lines 288-293
change_hostname()
Link Here
|
288 |
if (skip) exit 0; |
288 |
if (skip) exit 0; |
289 |
if (ip == "") { ip = "127.0.0.1" } |
289 |
if (ip == "") { ip = "127.0.0.1" } |
290 |
print comm; |
290 |
print comm; |
|
|
291 |
print "# ALL CHANGES BELOW THIS LINE WILL BE LOST"; |
291 |
alias="" |
292 |
alias="" |
292 |
if ((i=index(host, ".")) > 1) { |
293 |
if ((i=index(host, ".")) > 1) { |
293 |
alias=substr(host, 1, i - 1); |
294 |
alias=substr(host, 1, i - 1); |