diff options
| author | rs200217 <none@none> | 2006-08-18 12:23:13 -0700 |
|---|---|---|
| committer | rs200217 <none@none> | 2006-08-18 12:23:13 -0700 |
| commit | 27092493f25ffcb9366c35fb42b2b004a5b527ec (patch) | |
| tree | 992cb3b2842ecc292cf058f73bb872569bbda955 /usr/src/cmd/svc | |
| parent | 32232bf4531ddb458488ba01c9df68685921ebf4 (diff) | |
| download | illumos-joyent-27092493f25ffcb9366c35fb42b2b004a5b527ec.tar.gz | |
PSARC 2006/299 single hosts file
6219146 /etc/inet/hosts and /etc/inet/ipnodes need to be the same file
--HG--
rename : usr/src/cmd/cmd-inet/etc/ipnodes => deleted_files/usr/src/cmd/cmd-inet/etc/ipnodes
Diffstat (limited to 'usr/src/cmd/svc')
| -rw-r--r-- | usr/src/cmd/svc/milestone/net-svc | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/usr/src/cmd/svc/milestone/net-svc b/usr/src/cmd/svc/milestone/net-svc index 3f9531b8fb..e71e34c0d4 100644 --- a/usr/src/cmd/svc/milestone/net-svc +++ b/usr/src/cmd/svc/milestone/net-svc @@ -133,13 +133,13 @@ update_nss () } # -# update_files -# This routine takes as a parameter, the name of the respective file -# (hosts or ipnodes) to update with the new host name and IP address. +# update_hosts_file +# This routine updates the /etc/inet/hosts file with the hostname and IP +# address that was obtained via DHCP. # -update_files () +update_hosts_file () { - filename=$1; + filename=hosts # Delete any old lines added by dhcp. /usr/bin/sed -e '/# Added by DHCP$/d' /etc/inet/${filename} \ > /tmp/${filename}_clear.$$ @@ -286,12 +286,11 @@ if [ "$_INIT_NET_STRATEGY" = "dhcp" ]; then hostname=`/usr/bin/uname -n` ipaddr=`/sbin/dhcpinfo Yiaddr` - update_files hosts - update_files ipnodes + update_hosts_file else # We're not using a dhcp strategy, so host entries added by - # DHCP should be removed from /etc/inet/hosts and /etc/inet/ipnodes. + # DHCP should be removed from /etc/inet/hosts. if /usr/bin/grep '# Added by DHCP$' /etc/inet/hosts >/dev/null 2>&1; then @@ -299,13 +298,6 @@ else /etc/inet/hosts > /tmp/hosts.$$ mv_file /tmp/hosts.$$ /etc/inet/hosts 444 fi - - if /usr/bin/grep '# Added by DHCP$' /etc/inet/ipnodes >/dev/null 2>&1; - then - /usr/bin/sed -e '/# Added by DHCP$/d' \ - /etc/inet/ipnodes > /tmp/ipnodes.$$ - mv_file /tmp/ipnodes.$$ /etc/inet/ipnodes 444 - fi fi # |
