blob: f7ee533d228fa8af1040258468912c19c2cd3526 [file] [log] [blame]
Denys Vlasenko6cf7f012009-11-06 04:04:19 +01001#!/bin/sh
2echo "\
3# This file is automagically regenerated
4# Note! /etc/nsswitch.conf may override this!
5
6# For loopbacking
7127.0.0.1 localhost
8
9# Our local IPs"
10
11hostname=`hostname`
12test "$hostname" || hostname=localhost
13domain=`(. /boot.conf; echo "$DNSDOMAINNAME")`
14test "$domain" && hostname="$hostname $hostname.$domain"
15
16ip -o a l \
17| grep -F 'inet ' \
18| sed -e 's/^.*inet //' -e 's:[ /].*$: '"$hostname"':'
19
20echo
21echo "# End of /etc/hosts"