Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/svc/milestone/net-svc
          +++ new/usr/src/cmd/svc/milestone/net-svc
↓ open down ↓ 129 lines elided ↑ open up ↑
 130  130  #
 131  131  update_resolv ()
 132  132  {
 133  133          dnsservers=$1
 134  134          dnsdomain=$2
 135  135  
 136  136          if [ ! -f /etc/resolv.conf ]; then
 137  137                  /usr/bin/touch /etc/resolv.conf
 138  138          fi
 139  139          export dnsservers dnsdomain
 140      -        /usr/bin/nawk </etc/resolv.conf >/tmp/resolv.conf.$$ '
      140 +        /usr/xpg4/bin/awk </etc/resolv.conf >/tmp/resolv.conf.$$ '
 141  141                  function writedomain() {
 142  142                          if (updated == 0) {
 143  143                                  # Use only first domain, not a search list
 144  144                                  split(ENVIRON["dnsdomain"], d)
 145  145                                  if(length(d[1]) != 0)
 146  146                                          printf("domain %s\n", d[1])
 147  147                          }
 148  148                          ++updated
 149  149                  }
 150  150                  $1 == "domain" { writedomain(); next }
↓ open down ↓ 61 lines elided ↑ open up ↑
 212  212              /etc/nsswitch.conf >/tmp/nsswitch.conf.$$
 213  213  
 214  214          mv_file /tmp/nsswitch.conf.$$ /etc/nsswitch.conf 644
 215  215  }
 216  216  
 217  217  #
 218  218  # Remove any lines with the "# Added by DHCP" tag from /etc/inet/hosts.
 219  219  #
 220  220  cleanup_hosts ()
 221  221  {
 222      -        /usr/bin/nawk '{
      222 +        /usr/xpg4/bin/awk '{
 223  223                  if (index($0, "# Added by DHCP") == 0 ||
 224  224                      $1 == "127.0.0.1" || $1 == "::1") {
 225  225                          print $0
 226  226                  }
 227  227          }' /etc/inet/hosts > /tmp/hosts.$$
 228  228          mv_file /tmp/hosts.$$ /etc/inet/hosts 444
 229  229  }
 230  230  
 231  231  #
 232  232  # If our network configuration strategy is DHCP, check for DNS
↓ open down ↓ 38 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX