2002-05-01 01:13:15 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Script to install Shoreline Firewall
|
|
|
|
#
|
2003-02-23 15:10:37 +01:00
|
|
|
# This program is under GPL [http://www.gnu.org/copyleft/gpl.htm]
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2006-01-16 16:19:10 +01:00
|
|
|
# (c) 2000,2001,2002,2003,2004,2005 - Tom Eastep (teastep@shorewall.net)
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
# Shorewall documentation is available at http://shorewall.net
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
2003-02-23 15:10:37 +01:00
|
|
|
# it under the terms of Version 2 of the GNU General Public License
|
2002-05-01 01:13:15 +02:00
|
|
|
# as published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# 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 for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA
|
|
|
|
#
|
|
|
|
|
2006-10-29 18:23:06 +01:00
|
|
|
VERSION=3.3.4
|
2006-08-23 02:19:00 +02:00
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
usage() # $1 = exit status
|
|
|
|
{
|
2005-07-09 06:45:32 +02:00
|
|
|
ME=$(basename $0)
|
|
|
|
echo "usage: $ME"
|
|
|
|
echo " $ME -v"
|
|
|
|
echo " $ME -h"
|
2006-08-09 01:03:06 +02:00
|
|
|
echo " $ME -n"
|
2002-05-01 01:13:15 +02:00
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
2005-12-13 20:42:23 +01:00
|
|
|
split() {
|
|
|
|
local ifs=$IFS
|
|
|
|
IFS=:
|
|
|
|
set -- $1
|
|
|
|
echo $*
|
|
|
|
IFS=$ifs
|
|
|
|
}
|
|
|
|
|
|
|
|
qt()
|
|
|
|
{
|
|
|
|
"$@" >/dev/null 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
mywhich() {
|
|
|
|
local dir
|
|
|
|
|
|
|
|
for dir in $(split $PATH); do
|
|
|
|
if [ -x $dir/$1 ]; then
|
|
|
|
echo $dir/$1
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
run_install()
|
|
|
|
{
|
|
|
|
if ! install $*; then
|
2002-11-11 00:25:19 +01:00
|
|
|
echo
|
2005-09-13 19:13:35 +02:00
|
|
|
echo "ERROR: Failed to install $*" >&2
|
2002-05-01 01:13:15 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cant_autostart()
|
|
|
|
{
|
2002-11-11 00:25:19 +01:00
|
|
|
echo
|
2005-09-13 19:13:35 +02:00
|
|
|
echo "WARNING: Unable to configure shorewall to start automatically at boot" >&2
|
2002-05-01 01:13:15 +02:00
|
|
|
}
|
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
backup_directory() # $1 = directory to backup
|
|
|
|
{
|
|
|
|
if [ -d $1 ]; then
|
2005-09-01 00:21:22 +02:00
|
|
|
if cp -a $1 ${1}-${VERSION}.bkout ; then
|
2005-08-31 23:58:24 +02:00
|
|
|
echo
|
|
|
|
echo "$1 saved to ${1}-${VERSION}.bkout"
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
2005-09-01 00:21:22 +02:00
|
|
|
fi
|
2005-08-31 23:58:24 +02:00
|
|
|
}
|
2005-10-04 22:17:30 +02:00
|
|
|
|
2005-09-13 19:13:35 +02:00
|
|
|
backup_file() # $1 = file to backup, $2 = (optional) Directory in which to create the backup
|
2002-05-01 01:13:15 +02:00
|
|
|
{
|
2006-08-09 01:03:06 +02:00
|
|
|
if [ -z "${PREFIX}{NOBACKUP}" ]; then
|
2005-09-13 19:13:35 +02:00
|
|
|
if [ -f $1 -a ! -f ${1}-${VERSION}.bkout ]; then
|
|
|
|
if [ -n "$2" ]; then
|
|
|
|
if [ -d $2 ]; then
|
|
|
|
if cp -f $1 $2 ; then
|
|
|
|
echo
|
|
|
|
echo "$1 saved to $2/$(basename $1)"
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif cp $1 ${1}-${VERSION}.bkout; then
|
|
|
|
echo
|
|
|
|
echo "$1 saved to ${1}-${VERSION}.bkout"
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2003-02-08 21:58:44 +01:00
|
|
|
delete_file() # $1 = file to delete
|
|
|
|
{
|
2005-10-06 00:51:29 +02:00
|
|
|
rm -f $1
|
2003-02-23 15:10:37 +01:00
|
|
|
}
|
2003-02-08 21:58:44 +01:00
|
|
|
|
2005-09-01 00:21:22 +02:00
|
|
|
install_file() # $1 = source $2 = target $3 = mode
|
|
|
|
{
|
|
|
|
run_install $OWNERSHIP -m $3 $1 ${2}
|
|
|
|
}
|
|
|
|
|
2005-09-13 19:13:35 +02:00
|
|
|
install_file_with_backup() # $1 = source $2 = target $3 = mode $4 = (optional) backup directory
|
2003-02-23 15:10:37 +01:00
|
|
|
{
|
2005-09-13 19:13:35 +02:00
|
|
|
backup_file $2 $4
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m $3 $1 ${2}
|
2002-05-01 01:13:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Parse the run line
|
|
|
|
#
|
|
|
|
# DEST is the SysVInit script directory
|
2005-07-09 06:45:32 +02:00
|
|
|
# INIT is the name of the script in the $DEST directory
|
2002-05-01 01:13:15 +02:00
|
|
|
# RUNLEVELS is the chkconfig parmeters for firewall
|
2006-08-27 19:27:48 +02:00
|
|
|
# ARGS is "yes" if we've already parsed an argument
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
ARGS=""
|
2002-05-01 01:13:15 +02:00
|
|
|
|
2005-07-09 06:45:32 +02:00
|
|
|
if [ -z "$DEST" ] ; then
|
|
|
|
DEST="/etc/init.d"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$INIT" ] ; then
|
|
|
|
INIT="shorewall"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$RUNLEVELS" ] ; then
|
|
|
|
RUNLEVELS=""
|
|
|
|
fi
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
if [ -z "$OWNER" ] ; then
|
|
|
|
OWNER=root
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$GROUP" ] ; then
|
|
|
|
GROUP=root
|
|
|
|
fi
|
|
|
|
|
2006-08-09 01:03:06 +02:00
|
|
|
NOBACKUP=
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
case "$1" in
|
|
|
|
-h|help|?)
|
|
|
|
usage 0
|
|
|
|
;;
|
|
|
|
-v)
|
2002-06-15 19:27:41 +02:00
|
|
|
echo "Shorewall Firewall Installer Version $VERSION"
|
2002-05-01 01:13:15 +02:00
|
|
|
exit 0
|
|
|
|
;;
|
2006-08-09 01:03:06 +02:00
|
|
|
-n)
|
|
|
|
NOBACKUP=Yes
|
|
|
|
;;
|
2002-05-01 01:13:15 +02:00
|
|
|
*)
|
2005-07-09 06:45:32 +02:00
|
|
|
usage 1
|
2002-05-01 01:13:15 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
2006-08-27 19:27:48 +02:00
|
|
|
ARGS="yes"
|
2002-05-01 01:13:15 +02:00
|
|
|
done
|
2002-10-09 17:05:53 +02:00
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
2003-02-23 15:10:37 +01:00
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Determine where to install the firewall script
|
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
DEBIAN=
|
|
|
|
|
2005-07-09 07:45:05 +02:00
|
|
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
if [ -n "$PREFIX" ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
if [ `id -u` != 0 ] ; then
|
|
|
|
echo "Not setting file owner/group permissions, not running as root."
|
|
|
|
OWNERSHIP=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
|
|
|
|
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
2005-07-09 06:45:32 +02:00
|
|
|
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
|
|
|
|
DEBIAN=yes
|
2005-07-09 07:45:05 +02:00
|
|
|
elif [ -f /etc/slackware-version ] ; then
|
|
|
|
DEST="/etc/rc.d"
|
|
|
|
INIT="rc.firewall"
|
2005-10-04 22:17:30 +02:00
|
|
|
elif [ -f /etc/arch-release ] ; then
|
2005-08-06 18:58:18 +02:00
|
|
|
DEST="/etc/rc.d"
|
|
|
|
INIT="shorewall"
|
|
|
|
ARCHLINUX=yes
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Change to the directory containing this script
|
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
cd "$(dirname $0)"
|
2003-02-23 15:10:37 +01:00
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
echo "Installing Shorewall Version $VERSION"
|
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
#
|
|
|
|
# First do Backups
|
|
|
|
#
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Check for /etc/shorewall
|
|
|
|
#
|
|
|
|
if [ -d ${PREFIX}/etc/shorewall ]; then
|
|
|
|
first_install=""
|
2006-08-09 01:03:06 +02:00
|
|
|
if [ -z "$NOBACKUP" ]; then
|
|
|
|
backup_directory ${PREFIX}/etc/shorewall
|
|
|
|
backup_directory ${PREFIX}/usr/share/shorewall
|
|
|
|
backup_directory ${PREFIX}/var/lib/shorewall
|
|
|
|
fi
|
2005-09-01 00:21:22 +02:00
|
|
|
else
|
|
|
|
first_install="Yes"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
|
2006-06-12 19:48:20 +02:00
|
|
|
install_file_with_backup shorewall ${PREFIX}/sbin/shorewall 0555 ${PREFIX}/var/lib/shorewall-${VERSION}.bkout
|
|
|
|
|
|
|
|
echo "shorewall control program installed in ${PREFIX}/sbin/shorewall"
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
if [ -n "$DEBIAN" ]; then
|
2005-09-13 19:13:35 +02:00
|
|
|
install_file_with_backup init.debian.sh /etc/init.d/shorewall 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
2005-11-22 23:48:18 +01:00
|
|
|
elif [ -n "$ARCHLINUX" ]; then
|
|
|
|
install_file_with_backup init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
else
|
2005-09-13 19:13:35 +02:00
|
|
|
install_file_with_backup init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
2003-02-23 15:10:37 +01:00
|
|
|
|
2005-07-09 06:45:32 +02:00
|
|
|
echo "Shorewall script installed in ${PREFIX}${DEST}/$INIT"
|
2002-05-01 01:13:15 +02:00
|
|
|
|
|
|
|
#
|
2003-02-08 21:58:44 +01:00
|
|
|
# Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2005-07-09 07:45:05 +02:00
|
|
|
mkdir -p ${PREFIX}/etc/shorewall
|
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall
|
2006-08-27 19:27:48 +02:00
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall/configfiles
|
2005-07-09 07:45:05 +02:00
|
|
|
mkdir -p ${PREFIX}/var/lib/shorewall
|
2006-01-21 00:50:45 +01:00
|
|
|
|
|
|
|
chmod 755 ${PREFIX}/etc/shorewall
|
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall
|
2006-08-27 19:27:48 +02:00
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall/configfiles
|
2006-01-21 00:50:45 +01:00
|
|
|
|
2006-11-06 19:20:48 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 Documentation ${PREFIX}/etc/shorewall/Documentation
|
2006-08-27 19:27:48 +02:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 shorewall.conf ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2006-08-27 19:27:48 +02:00
|
|
|
qt mywhich perl && perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall/configfiles:/usr/share/shorewall|;' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf
|
2005-08-06 18:58:18 +02:00
|
|
|
|
2006-08-19 19:04:36 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/shorewall.conf ]; then
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 shorewall.conf ${PREFIX}/etc/shorewall/shorewall.conf
|
|
|
|
echo "Config file installed as ${PREFIX}/etc/shorewall/shorewall.conf"
|
2006-08-19 19:04:36 +02:00
|
|
|
fi
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2006-08-27 19:27:48 +02:00
|
|
|
|
2005-08-06 18:58:18 +02:00
|
|
|
if [ -n "$ARCHLINUX" ] ; then
|
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall/shorewall.conf
|
2005-10-04 22:17:30 +02:00
|
|
|
fi
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 zones ${PREFIX}/usr/share/shorewall/configfiles/zones
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/zones ]; then
|
2005-09-01 01:00:24 +02:00
|
|
|
run_install $OWNERSHIP -m 0744 zones ${PREFIX}/etc/shorewall/zones
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Zones file installed as ${PREFIX}/etc/shorewall/zones"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
|
2006-01-22 17:29:33 +01:00
|
|
|
#
|
|
|
|
# Install the Compiler
|
|
|
|
#
|
|
|
|
|
|
|
|
install_file compiler ${PREFIX}/usr/share/shorewall/compiler 0555
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Compiler installed in ${PREFIX}/usr/share/shorewall/compiler"
|
|
|
|
|
2003-07-27 20:17:39 +02:00
|
|
|
# Install the Help file
|
|
|
|
#
|
2006-06-19 22:31:52 +02:00
|
|
|
install_file help ${PREFIX}/usr/share/shorewall/help 0555
|
2003-07-27 20:17:39 +02:00
|
|
|
|
|
|
|
echo "Help command executor installed in ${PREFIX}/usr/share/shorewall/help"
|
2003-02-08 21:58:44 +01:00
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 policy ${PREFIX}/usr/share/shorewall/configfiles/policy
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/policy ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 policy ${PREFIX}/etc/shorewall/policy
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Policy file installed as ${PREFIX}/etc/shorewall/policy"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 interfaces ${PREFIX}/usr/share/shorewall/configfiles/interfaces
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/interfaces ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 interfaces ${PREFIX}/etc/shorewall/interfaces
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Interfaces file installed as ${PREFIX}/etc/shorewall/interfaces"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
2005-07-09 07:45:05 +02:00
|
|
|
# Install the ipsec file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 ipsec ${PREFIX}/usr/share/shorewall/configfiles/ipsec
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/ipsec ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 ipsec ${PREFIX}/etc/shorewall/ipsec
|
2005-07-26 01:08:09 +02:00
|
|
|
echo "Dummy IPSEC file installed as ${PREFIX}/etc/shorewall/ipsec"
|
2005-07-09 07:45:05 +02:00
|
|
|
fi
|
2005-07-26 01:08:09 +02:00
|
|
|
|
2005-07-09 07:45:05 +02:00
|
|
|
#
|
2002-05-01 01:13:15 +02:00
|
|
|
# Install the hosts file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 hosts ${PREFIX}/usr/share/shorewall/configfiles/hosts
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/hosts ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 hosts ${PREFIX}/etc/shorewall/hosts
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Hosts file installed as ${PREFIX}/etc/shorewall/hosts"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 rules ${PREFIX}/usr/share/shorewall/configfiles/rules
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/rules ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 rules ${PREFIX}/etc/shorewall/rules
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Rules file installed as ${PREFIX}/etc/shorewall/rules"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the NAT file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 nat ${PREFIX}/usr/share/shorewall/configfiles/nat
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/nat ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 nat ${PREFIX}/etc/shorewall/nat
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "NAT file installed as ${PREFIX}/etc/shorewall/nat"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
2003-02-23 15:10:37 +01:00
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
# Install the NETMAP file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 netmap ${PREFIX}/usr/share/shorewall/configfiles/netmap
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/netmap ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 netmap ${PREFIX}/etc/shorewall/netmap
|
2005-07-09 06:45:32 +02:00
|
|
|
echo "NETMAP file installed as ${PREFIX}/etc/shorewall/netmap"
|
|
|
|
fi
|
|
|
|
#
|
2002-05-01 01:13:15 +02:00
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${PREFIX}/usr/share/shorewall/configfiles/params
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/params ]; then
|
2006-06-28 17:22:01 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${PREFIX}/etc/shorewall/params
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Parameter file installed as ${PREFIX}/etc/shorewall/params"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the proxy ARP file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 proxyarp ${PREFIX}/usr/share/shorewall/configfiles/proxyarp
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/proxyarp ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 proxyarp ${PREFIX}/etc/shorewall/proxyarp
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Proxy ARP file installed as ${PREFIX}/etc/shorewall/proxyarp"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
2002-07-11 02:01:45 +02:00
|
|
|
# Install the Stopped Routing file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 routestopped ${PREFIX}/usr/share/shorewall/configfiles/routestopped
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/routestopped ]; then
|
2005-09-01 00:21:22 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 routestopped ${PREFIX}/etc/shorewall/routestopped
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Stopped Routing file installed as ${PREFIX}/etc/shorewall/routestopped"
|
2002-07-11 02:01:45 +02:00
|
|
|
fi
|
|
|
|
#
|
2002-10-22 20:07:52 +02:00
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 maclist ${PREFIX}/usr/share/shorewall/configfiles/maclist
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/maclist ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 maclist ${PREFIX}/etc/shorewall/maclist
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "MAC list file installed as ${PREFIX}/etc/shorewall/maclist"
|
2002-10-22 20:07:52 +02:00
|
|
|
fi
|
|
|
|
#
|
2002-05-01 01:13:15 +02:00
|
|
|
# Install the Masq file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 masq ${PREFIX}/usr/share/shorewall/configfiles/masq
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/masq ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 masq ${PREFIX}/etc/shorewall/masq
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Masquerade file installed as ${PREFIX}/etc/shorewall/masq"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
2006-09-07 22:48:40 +02:00
|
|
|
# Install the Modules file
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2006-07-21 19:58:14 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall/modules
|
|
|
|
echo "Modules file installed as ${PREFIX}/usr/share/shorewall/modules"
|
2006-05-20 17:24:06 +02:00
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Install the TC Rules file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcrules ${PREFIX}/usr/share/shorewall/configfiles/tcrules
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/tcrules ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcrules ${PREFIX}/etc/shorewall/tcrules
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "TC Rules file installed as ${PREFIX}/etc/shorewall/tcrules"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tos ${PREFIX}/usr/share/shorewall/configfiles/tos
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-09-13 19:13:35 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/tos ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tos ${PREFIX}/etc/shorewall/tos
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "TOS file installed as ${PREFIX}/etc/shorewall/tos"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tunnels ${PREFIX}/usr/share/shorewall/configfiles/tunnels
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/tunnels ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tunnels ${PREFIX}/etc/shorewall/tunnels
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Tunnels file installed as ${PREFIX}/etc/shorewall/tunnels"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the blacklist file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 blacklist ${PREFIX}/usr/share/shorewall/configfiles/blacklist
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/blacklist ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 blacklist ${PREFIX}/etc/shorewall/blacklist
|
2002-11-11 00:25:19 +01:00
|
|
|
echo "Blacklist file installed as ${PREFIX}/etc/shorewall/blacklist"
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
2005-07-09 07:55:29 +02:00
|
|
|
#
|
2005-07-26 01:08:09 +02:00
|
|
|
# Delete the Routes file
|
2005-07-09 07:55:29 +02:00
|
|
|
#
|
2005-10-06 00:51:29 +02:00
|
|
|
delete_file ${PREFIX}/etc/shorewall/routes
|
|
|
|
#
|
|
|
|
# Delete the tcstart file
|
|
|
|
#
|
|
|
|
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/tcstart
|
2005-07-09 07:55:29 +02:00
|
|
|
|
2006-08-31 00:04:49 +02:00
|
|
|
#
|
|
|
|
# Delete the Limits Files
|
|
|
|
#
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/action.Limit
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/Limit
|
2006-09-03 22:01:18 +02:00
|
|
|
#
|
2006-09-07 22:48:40 +02:00
|
|
|
# Delete the xmodules file
|
|
|
|
#
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/xmodules
|
|
|
|
#
|
2005-07-09 07:55:29 +02:00
|
|
|
# Install the Providers file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 providers ${PREFIX}/usr/share/shorewall/configfiles/providers
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/providers ]; then
|
2005-07-09 07:55:29 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 providers ${PREFIX}/etc/shorewall/providers
|
|
|
|
echo "Providers file installed as ${PREFIX}/etc/shorewall/providers"
|
2005-08-31 22:48:22 +02:00
|
|
|
fi
|
|
|
|
|
2006-04-02 17:22:14 +02:00
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 route_rules ${PREFIX}/usr/share/shorewall/configfiles/route_rules
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2006-04-14 19:10:14 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/route_rules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 route_rules ${PREFIX}/etc/shorewall/route_rules
|
|
|
|
echo "Routing rules file installed as ${PREFIX}/etc/shorewall/route_rules"
|
2006-04-02 17:22:14 +02:00
|
|
|
fi
|
|
|
|
|
2005-08-31 22:48:22 +02:00
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses ${PREFIX}/usr/share/shorewall/configfiles/tcclasses
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/tcclasses ]; then
|
2005-08-31 22:48:22 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcclasses ${PREFIX}/etc/shorewall/tcclasses
|
|
|
|
echo "TC Classes file installed as ${PREFIX}/etc/shorewall/tcclasses"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices ${PREFIX}/usr/share/shorewall/configfiles/tcdevices
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/tcdevices ]; then
|
2005-08-31 22:48:22 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcdevices ${PREFIX}/etc/shorewall/tcdevices
|
|
|
|
echo "TC Devices file installed as ${PREFIX}/etc/shorewall/tcdevices"
|
2005-07-09 07:55:29 +02:00
|
|
|
fi
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2002-06-01 02:28:18 +02:00
|
|
|
# Install the rfc1918 file
|
|
|
|
#
|
2006-06-16 05:47:57 +02:00
|
|
|
install_file rfc1918 ${PREFIX}/usr/share/shorewall/rfc1918 0644
|
2005-07-09 06:45:32 +02:00
|
|
|
echo "RFC 1918 file installed as ${PREFIX}/usr/share/shorewall/rfc1918"
|
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
2006-06-03 17:16:21 +02:00
|
|
|
install_file configpath ${PREFIX}/usr/share/shorewall/configpath 0644
|
2005-09-13 19:13:35 +02:00
|
|
|
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall/configpath"
|
2002-06-01 02:28:18 +02:00
|
|
|
#
|
2002-12-19 21:14:10 +01:00
|
|
|
# Install the init file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 init ${PREFIX}/usr/share/shorewall/configfiles/init
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/init ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 init ${PREFIX}/etc/shorewall/init
|
2002-12-19 21:14:10 +01:00
|
|
|
echo "Init file installed as ${PREFIX}/etc/shorewall/init"
|
|
|
|
fi
|
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
# Install the initdone file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 initdone ${PREFIX}/usr/share/shorewall/configfiles/initdone
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/initdone ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 initdone ${PREFIX}/etc/shorewall/initdone
|
2005-07-09 06:45:32 +02:00
|
|
|
echo "Initdone file installed as ${PREFIX}/etc/shorewall/initdone"
|
|
|
|
fi
|
|
|
|
#
|
2002-12-19 21:14:10 +01:00
|
|
|
# Install the start file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 start ${PREFIX}/usr/share/shorewall/configfiles/start
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/start ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 start ${PREFIX}/etc/shorewall/start
|
2002-12-19 21:14:10 +01:00
|
|
|
echo "Start file installed as ${PREFIX}/etc/shorewall/start"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 stop ${PREFIX}/usr/share/shorewall/configfiles/stop
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/stop ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 stop ${PREFIX}/etc/shorewall/stop
|
2002-12-19 21:14:10 +01:00
|
|
|
echo "Stop file installed as ${PREFIX}/etc/shorewall/stop"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 stopped ${PREFIX}/usr/share/shorewall/configfiles/stopped
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/stopped ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 stopped ${PREFIX}/etc/shorewall/stopped
|
2002-12-19 21:14:10 +01:00
|
|
|
echo "Stopped file installed as ${PREFIX}/etc/shorewall/stopped"
|
|
|
|
fi
|
|
|
|
#
|
2003-02-24 16:24:55 +01:00
|
|
|
# Install the ECN file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 ecn ${PREFIX}/usr/share/shorewall/configfiles/ecn
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/ecn ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 ecn ${PREFIX}/etc/shorewall/ecn
|
2003-08-22 17:27:08 +02:00
|
|
|
echo "ECN file installed as ${PREFIX}/etc/shorewall/ecn"
|
2003-02-24 16:24:55 +01:00
|
|
|
fi
|
2003-08-22 17:27:08 +02:00
|
|
|
#
|
2003-08-10 03:11:50 +02:00
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 accounting ${PREFIX}/usr/share/shorewall/configfiles/accounting
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/accounting ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 accounting ${PREFIX}/etc/shorewall/accounting
|
2003-08-10 03:11:50 +02:00
|
|
|
echo "Accounting file installed as ${PREFIX}/etc/shorewall/accounting"
|
|
|
|
fi
|
2003-02-24 16:24:55 +01:00
|
|
|
#
|
2005-07-09 07:45:05 +02:00
|
|
|
# Install the Continue file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 continue ${PREFIX}/usr/share/shorewall/configfiles/continue
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/continue ]; then
|
2005-07-09 07:45:05 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 continue ${PREFIX}/etc/shorewall/continue
|
|
|
|
echo "Continue file installed as ${PREFIX}/etc/shorewall/continue"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Started file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 started ${PREFIX}/usr/share/shorewall/configfiles/started
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/started ]; then
|
2005-07-09 07:55:29 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 started ${PREFIX}/etc/shorewall/started
|
2005-07-09 07:45:05 +02:00
|
|
|
echo "Started file installed as ${PREFIX}/etc/shorewall/started"
|
|
|
|
fi
|
2003-08-22 17:27:08 +02:00
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
# Install the Standard Actions file
|
2003-08-23 20:14:59 +02:00
|
|
|
#
|
2006-01-21 00:50:45 +01:00
|
|
|
install_file actions.std ${PREFIX}/usr/share/shorewall/actions.std 0644
|
2005-07-09 06:45:32 +02:00
|
|
|
echo "Standard actions file installed as ${PREFIX}/etc/shorewall/actions.std"
|
|
|
|
|
2003-08-22 17:27:08 +02:00
|
|
|
#
|
2003-12-04 03:01:08 +01:00
|
|
|
# Install the Actions file
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 actions ${PREFIX}/usr/share/shorewall/configfiles/actions
|
2006-05-30 22:10:52 +02:00
|
|
|
|
2005-08-31 23:58:24 +02:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/actions ]; then
|
2006-01-21 00:50:45 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 actions ${PREFIX}/etc/shorewall/actions
|
2003-12-04 03:01:08 +01:00
|
|
|
echo "Actions file installed as ${PREFIX}/etc/shorewall/actions"
|
|
|
|
fi
|
2005-08-06 18:58:18 +02:00
|
|
|
|
2005-09-18 18:58:05 +02:00
|
|
|
#
|
|
|
|
# Install the Makefile
|
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 Makefile ${PREFIX}/usr/share/shorewall/configfiles/Makefile
|
2005-09-14 20:33:06 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall/Makefile
|
|
|
|
echo "Makefile installed as ${PREFIX}/etc/shorewall/Makefile"
|
2006-08-27 19:27:48 +02:00
|
|
|
|
2003-12-04 03:01:08 +01:00
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
# Install the Action files
|
2003-12-04 03:01:08 +01:00
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
for f in action.* ; do
|
2006-01-21 00:50:45 +01:00
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
2005-07-09 07:45:05 +02:00
|
|
|
echo "Action ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f"
|
2005-07-09 06:45:32 +02:00
|
|
|
done
|
2006-08-27 19:27:48 +02:00
|
|
|
|
|
|
|
# Install the Macro files
|
2006-08-19 00:56:20 +02:00
|
|
|
#
|
2006-08-27 19:27:48 +02:00
|
|
|
for f in macro.* ; do
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f"
|
2006-08-19 00:56:20 +02:00
|
|
|
done
|
2006-01-18 00:27:54 +01:00
|
|
|
#
|
2006-08-27 20:42:30 +02:00
|
|
|
# Install the libraries
|
|
|
|
#
|
|
|
|
for f in lib.* ; do
|
|
|
|
if [ -f $f ]; then
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
2006-10-29 18:29:46 +01:00
|
|
|
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f"
|
2006-08-27 20:42:30 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
#
|
2006-09-09 18:35:27 +02:00
|
|
|
# Symbolically link 'functions' to lib.base
|
|
|
|
#
|
|
|
|
ln -sf lib.base ${PREFIX}/usr/share/shorewall/functions
|
|
|
|
#
|
2006-01-18 00:27:54 +01:00
|
|
|
# Install the program skeleton files
|
|
|
|
#
|
|
|
|
for f in prog.* ; do
|
2006-01-21 00:50:45 +01:00
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
2006-01-18 00:27:54 +01:00
|
|
|
echo "Program skeleton file ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f"
|
|
|
|
done
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Create the version file
|
|
|
|
#
|
2003-02-08 21:58:44 +01:00
|
|
|
echo "$VERSION" > ${PREFIX}/usr/share/shorewall/version
|
|
|
|
chmod 644 ${PREFIX}/usr/share/shorewall/version
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
2003-02-08 21:58:44 +01:00
|
|
|
# Remove and create the symbolic link to the init script
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
if [ -z "$PREFIX" ]; then
|
2003-02-08 21:58:44 +01:00
|
|
|
rm -f /usr/share/shorewall/init
|
2005-07-09 06:45:32 +02:00
|
|
|
ln -s ${DEST}/${INIT} /usr/share/shorewall/init
|
2002-05-01 01:13:15 +02:00
|
|
|
fi
|
2005-07-09 06:45:32 +02:00
|
|
|
|
2002-10-15 17:00:11 +02:00
|
|
|
#
|
|
|
|
# Install the firewall script
|
|
|
|
#
|
2006-06-19 22:31:52 +02:00
|
|
|
install_file firewall ${PREFIX}/usr/share/shorewall/firewall 0555
|
2002-05-01 01:13:15 +02:00
|
|
|
|
2005-07-09 07:45:05 +02:00
|
|
|
if [ -z "$PREFIX" -a -n "$first_install" ]; then
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall
|
|
|
|
ln -s ../init.d/shorewall /etc/rcS.d/S40shorewall
|
|
|
|
echo "shorewall will start automatically at boot"
|
|
|
|
echo "Set startup=1 in /etc/default/shorewall to enable"
|
2005-12-13 20:42:23 +01:00
|
|
|
touch /var/log/shorewall-init.log
|
2006-04-26 00:46:36 +02:00
|
|
|
qt mywhich perl && perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' /etc/shorewall/shorewall.conf
|
2005-07-09 07:45:05 +02:00
|
|
|
else
|
|
|
|
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
|
|
|
|
if insserv /etc/init.d/shorewall ; then
|
|
|
|
echo "shorewall will start automatically at boot"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/shorewall/shorewall.conf to enable"
|
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then
|
|
|
|
if chkconfig --add shorewall ; then
|
|
|
|
echo "shorewall will start automatically in run levels as follows:"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/shorewall/shorewall.conf to enable"
|
|
|
|
chkconfig --list shorewall
|
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ -x /sbin/rc-update ]; then
|
|
|
|
if rc-update add shorewall default; then
|
|
|
|
echo "shorewall will start automatically at boot"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/shorewall/shorewall.conf to enable"
|
|
|
|
else
|
2005-07-09 06:45:32 +02:00
|
|
|
cant_autostart
|
|
|
|
fi
|
2005-07-09 07:45:05 +02:00
|
|
|
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
|
|
|
cant_autostart
|
2005-07-09 06:45:32 +02:00
|
|
|
fi
|
2005-07-09 07:45:05 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2002-05-01 01:13:15 +02:00
|
|
|
#
|
|
|
|
# Report Success
|
|
|
|
#
|
2005-07-09 06:45:32 +02:00
|
|
|
echo "shorewall Version $VERSION Installed"
|