
#-----------------------------------------------------------------------
# Copyright (C) 2000-2001, Jean-Sebastien Morisset <jsmoriss@mvlan.net>
#-----------------------------------------------------------------------
# $Id: check_old_config_paths.sh,v 1.4 2001/08/11 17:01:20 jsmoriss Exp $
#-----------------------------------------------------------------------
#  $RCSfile: check_old_config_paths.sh,v $
#   $Author: jsmoriss $
# $Revision: 1.4 $
#     $Date: 2001/08/11 17:01:20 $
#   $Locker:  $ 
#     $Name:  $
#-----------------------------------------------------------------------
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by 
# the Free Software Foundation <http://www.gnu.org/copyleft/gpl.txt>.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License (LICENSE file in archive) for more details.
#
#-----------------------------------------------------------------------
# README
#-----------------------------------------------------------------------
#
# A bourne shell function used by rcf; a very secure, fast, and complete
# firewall for linux <http://jsmoriss.mvlan.net/linux/rcf.html>.
#
#-----------------------------------------------------------------------
# FUNCTION
#-----------------------------------------------------------------------

Check_Old_Config_Paths () {

	for CUSTOM_FILE in ${CONF}.custom ${0}.custom-ports ${0}.custom-pub-ports ${0}.custom-pri-ports
	do
		if [ -r "$CUSTOM_FILE" ]
		then
			echo "$CUSTOM_FILE ignored!"
			echo "Version 5 no longer supports the $CUSTOM_FILE file."
		fi
	done

	if [ -r "${0}.conf" ]
	then
		if [ ! -r "$CONF" ]
		then
			FAILED="yes"
			Sed_Cat <<EOF

The configuration file has moved to ${CONF} since version 5.0.
Moving ${0}.conf to ${CONF}...
EOF
			mv "${0}.conf" "${CONF}"
		else
			Sed_Cat <<EOF

Both ${CONF} and ${0}.conf exist!
The correct configuration file path is ${CONF}.
Please remove the old ${0}.conf file.
EOF
		fi
	fi

	if [ -d "/etc/firewall-modules" ]
	then
		echo "WARNING: /etc/firewall-modules is no longer used."
	fi

	if [ "$FAILED" ]
	then
		echo -n "Pausing for $ERROR_PAUSE secs..."; sleep $ERROR_PAUSE; echo ""
		echo ""
		unset FAILED
	fi
}

