#!/bin/sh

cd /usr/src
find . -name '*.ctm' -print |
while read file; do
	base=`dirname $file`/`basename $file .ctm`
	if [ -f $base.ctm -a -f $base.noipv6 ]; then
		if cmp -s $base.ctm $base.noipv6; then
			:
			#echo "# $base.ctm and $base.noipv6 ok"
		else
			echo "merging in $base"
			merge $base $base.noipv6 $base.ctm
			mv $base.noipv6 $base.noipv6.old
			mv $base.ctm $base.noipv6
		fi
	fi

done
