#!/bin/sh
#

if [ $# -lt 4 ]
then
    echo "Usage: $0 [old install] [install scripts] [destination] [audit]"
fi

TEKXPBOOT=$3/boot
TEKXPCONFIG=$3/config

CONFIG_FILES="fonts.tbl hosts.tbl nodes.tbl gateway.tbl nfs.tbl xhosts.tbl"

if [ ! -d $1 ]
then
    echo "Old Utilities Directory $1 does not exist"
    exit 0
fi

DATE=`date +%m%d%y%H%M`

# For now just copy the config files to the new boot area
if [ -d "$3/tekxp/boot/config" ]
then
    for file in $CONFIG_FILES
    do
    	if [ -f "$1/XP/site/$file" ]
    	then
	    if [ -f "$3/tekxp/boot/config/$file" ]
	    then
		mv $3/tekxp/boot/config/$file $3/tekxp/boot/config/$file.$DATE
	    fi
    	    cp $1/XP/site/$file $3/tekxp/boot/config
	    echo "Move $file from $1/XP/site/$file to $3/tekxp/boot/config" >> $4
    	fi
    done
else
    echo "Cannot find new configuration directory: $3/tekxp/boot/config"
fi

