#!/bin/sh # attempt to update /etc in a clean and polite manner # (c) 2000 Jeremy C. Reed # started 25/Oct/2000 # need to do: # save/backup old (in the meanwhile just backup yourself) # Edit (N)ew file # merge both and edit # check to make sure symlinks and permissions are correct # create new directory if doesn't exist # use for /var, /root, /tmp also CURRENTDIR=`pwd` OLD="" #NEW=NEW NEW=/home/reed/netbsd/1.5_BETA/NEW SKIPSAME=1 ## set to zero if you want to see everything TMPDIR=/tmp/_update_etc_dir.$$ if ! mkdir $TMPDIR; then echo can not create $TMPDIR. exit 1 fi trap '/bin/rm -rf $TMPDIR ; exit 0' 0 2 3 FILELIST=$TMPDIR/compare_etc_file_list.$$ DATAFILE=$TMPDIR/compare_etc_data.$$ if [$EDITOR -eq ""]; then EDITOR=vi fi cd $NEW/etc #for f in * ; do find . -type f -print | sed -e 's/^\.\///g' > $FILELIST cd $CURRENTDIR #while read filename; do for filename in `cat $FILELIST`; do LOOP=1 while [ $LOOP = 1 ]; do DIFFERENT=0 if [ ! -e "$OLD/etc/$filename" ] ; then echo echo \*------------- $filename -----------------\* ls -l $NEW/etc/$filename echo "$OLD/etc/$filename" does not exist DIFFERENT=1 cat < $DATAFILE if [ -s $DATAFILE ]; then echo echo \*------------- $filename -----------------\* ls -l $OLD/etc/$filename ls -l $NEW/etc/$filename echo $filename is different DIFFERENT=1 cat <