Home | History | Annotate | Download | only in common_files
      1 #!/bin/sh
      2 #
      3 # CDDL HEADER START
      4 #
      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
      8 # with the License.
      9 #
     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.
     14 #
     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]
     20 #
     21 # CDDL HEADER END
     22 #
     23 #
     24 #ident	"%Z%%M%	%I%	%E% SMI"
     25 #
     26 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
     27 # Use is subject to license terms.
     28 #
     29 
     30 while read src dest
     31 do
     32 	if [ ! -f $dest ] ; then
     33 		cp $src $dest
     34 	else
     35 		# Remove AF_INET-specific /dev/rts entry introduced in 2.6
     36 		grep -v "[ 	]*24[ 	]\{1,\}4[ 	]\{1,\}2[ 	]\{1,\}/dev/rts" \
     37 			$dest > /tmp/d.$$
     38 		cp /tmp/d.$$ $dest
     39 		rm -f /tmp/d.$$
     40 		grep '/dev/rts' $dest > /dev/null 2>&1
     41 		if [ $? != 0 ] ; then
     42 			echo >> $dest
     43 			grep '/dev/rts' $src >> $dest
     44 		fi
     45 		grep '/dev/tcp6' $dest > /dev/null 2>&1
     46 		if [ $? != 0 ] ; then
     47 			echo >> $dest
     48 			grep '/dev/tcp6' $src >> $dest
     49 		fi
     50 		grep '/dev/udp6' $dest > /dev/null 2>&1
     51 		if [ $? != 0 ] ; then
     52 			echo >> $dest
     53 			grep '/dev/udp6' $src >> $dest
     54 		fi
     55 		grep '/dev/rawip6' $dest > /dev/null 2>&1
     56 		if [ $? != 0 ] ; then
     57 			echo >> $dest
     58 			grep '/dev/rawip6' $src >> $dest
     59 		fi
     60 		grep '/dev/sctp\>' $dest > /dev/null 2>&1
     61 		if [ $? != 0 ] ; then
     62 			grep '/dev/sctp\>' $src >> $dest
     63 		fi
     64 		grep '/dev/sctp6' $dest > /dev/null 2>&1
     65 		if [ $? != 0 ] ; then
     66 			grep '/dev/sctp6' $src >> $dest
     67 		fi
     68 		grep '/dev/keysock' $dest > /dev/null 2>&1
     69 		if [ $? != 0 ] ; then
     70 			echo >> $dest
     71 			grep '/dev/keysock' $src >> $dest
     72 		fi
     73 		grep '/dev/nca' $dest > /dev/null 2>&1
     74 		if [ $? != 0 ] ; then
     75 			echo >> $dest
     76 			grep '/dev/nca' $src >> $dest
     77 		fi
     78 		grep '/dev/spdsock' $dest > /dev/null 2>&1
     79 		if [ $? != 0 ] ; then
     80 			echo >> $dest
     81 			grep '/dev/spdsock' $src >> $dest
     82 		fi
     83 	fi
     84 done
     85 
     86 exit 0
     87