5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
25 # Use is subject to license terms.
30 /usr
/bin
/awk '/UP/{if($2 !~ /LOOPBACK/){iface=$1;}} /ether/{if(iface){print $2; exit;}}' | \
31 /bin
/tr '[:lower:]' '[:upper:]' | \
32 /bin
/sed -e 's/^/ 0/g;s/:/ 0/g; s/0\([0-9A-F][0-9A-F]\)/\1/g; s/ //g;'
44 if [ ! -z $domain ]; then
45 cat <<EOF > $ALTROOT/etc/resolv.conf
50 sed -I -e 's/^hosts:.*/hosts: files dns/;' $ALTROOT/etc
/nsswitch.conf
51 sed -I -e 's/^ipnodes:.*/ipnodes: files dns/;' $ALTROOT/etc
/nsswitch.conf
55 # NOTE: If the nsswitch.conf file specifies DNS in a manner other than:
56 # "files dns", setting EnableDNS will have to become more sophisticated.
57 /usr
/bin
/grep -c 'files dns' $ALTROOT/etc
/nsswitch.conf
2> /dev
/null
> /dev
/null || EnableDNS
60 echo nameserver
$srv >> $ALTROOT/etc
/resolv.conf