# #ident "@(#)i.config 1.2" # # Copyright (c) 1997 by Sun Microsystems, Inc. # # If the config file is new (cmp) # backing up the old files, replace the current with the new one # also back up the new config file for next upgrade comparision # then update with the current machine host name # # If the config file has no change (cmp) # preserve the current config file # # When there is no config file (brand new), simply copy and backup the new file # then update with the current machine host name HOSTNAME=`/usr/bin/uname -n` while read src dest do if [ ! -f $dest ]; then echo $dest cp -p $src $dest # back up original copy cp -p $dest ${dest}.orig else # replace config file only when the current one is outdated if [ -f ${dest}.orig ] ; then cmp -s $src ${dest}.orig if [ $? != 0 ] ; then echo "Saving old config file ${dest} to ${dest}.SAVE" cp $dest ${dest}.SAVE # Removing old config file rm -f $dest # Install new config file cp -p $src $dest # "Back up an original copy" cp -p $dest ${dest}.orig # have postinstall install this backup file to DB fi fi fi done exit 0