2008-12-07 19:17:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Script to install Shoreline Firewall
|
|
|
|
#
|
|
|
|
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
|
|
|
#
|
2011-05-23 19:06:56 +02:00
|
|
|
# (c) 2000-2011 - Tom Eastep (teastep@shorewall.net)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Shorewall documentation is available at http://shorewall.net
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of Version 2 of the GNU General Public License
|
|
|
|
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
|
2011-07-13 16:10:07 +02:00
|
|
|
VERSION=xxx #The Build script inserts the actual version
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
usage() # $1 = exit status
|
|
|
|
{
|
|
|
|
ME=$(basename $0)
|
|
|
|
echo "usage: $ME"
|
|
|
|
echo " $ME -v"
|
|
|
|
echo " $ME -h"
|
2011-05-30 17:15:59 +02:00
|
|
|
echo " $ME -s"
|
2011-06-07 00:40:21 +02:00
|
|
|
echo " $ME -f"
|
2008-12-07 19:17:26 +01:00
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
|
|
|
split() {
|
|
|
|
local ifs
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
run_install()
|
|
|
|
{
|
|
|
|
if ! install $*; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: Failed to install $*" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cant_autostart()
|
|
|
|
{
|
|
|
|
echo
|
|
|
|
echo "WARNING: Unable to configure shorewall to start automatically at boot" >&2
|
|
|
|
}
|
|
|
|
|
|
|
|
delete_file() # $1 = file to delete
|
|
|
|
{
|
|
|
|
rm -f $1
|
|
|
|
}
|
|
|
|
|
|
|
|
install_file() # $1 = source $2 = target $3 = mode
|
|
|
|
{
|
2010-05-29 19:50:39 +02:00
|
|
|
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
2008-12-07 19:17:26 +01:00
|
|
|
}
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Parse the run line
|
|
|
|
#
|
|
|
|
# DEST is the SysVInit script directory
|
|
|
|
# INIT is the name of the script in the $DEST directory
|
|
|
|
# ARGS is "yes" if we've already parsed an argument
|
|
|
|
#
|
2010-05-29 19:50:39 +02:00
|
|
|
T="-T"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
if [ -z "$DEST" ] ; then
|
|
|
|
DEST="/etc/init.d"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$INIT" ] ; then
|
|
|
|
INIT="shorewall"
|
|
|
|
fi
|
|
|
|
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=
|
2010-02-27 20:48:39 +01:00
|
|
|
SPARSE=
|
2009-02-22 18:19:19 +01:00
|
|
|
MANDIR=${MANDIR:-"/usr/share/man"}
|
2011-04-17 20:20:26 +02:00
|
|
|
[ -n "${LIBEXEC:=/usr/share}" ]
|
|
|
|
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
2011-04-03 18:56:30 +02:00
|
|
|
|
2011-05-14 14:31:19 +02:00
|
|
|
case "$LIBEXEC" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
LIBEXEC=/usr/${LIBEXEC}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$PERLLIB" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PERLLIB=/usr/${PERLLIB}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2010-05-09 01:32:03 +02:00
|
|
|
INSTALLD='-D'
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
case $(uname) in
|
|
|
|
CYGWIN*)
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2009-07-25 16:44:53 +02:00
|
|
|
DEST=
|
|
|
|
INIT=
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
OWNER=$(id -un)
|
|
|
|
GROUP=$(id -gn)
|
|
|
|
CYGWIN=Yes
|
2010-02-27 20:48:39 +01:00
|
|
|
SPARSE=Yes
|
2008-12-07 19:17:26 +01:00
|
|
|
;;
|
2010-05-06 17:17:17 +02:00
|
|
|
Darwin)
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2010-05-06 17:17:17 +02:00
|
|
|
DEST=
|
|
|
|
INIT=
|
2010-05-09 01:32:03 +02:00
|
|
|
SPARSE=Yes
|
2010-05-06 17:17:17 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=wheel
|
|
|
|
MAC=Yes
|
2010-05-29 19:57:27 +02:00
|
|
|
INSTALLD=
|
2010-05-29 19:50:39 +02:00
|
|
|
T=
|
2010-06-07 18:16:56 +02:00
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=root
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
|
|
|
|
2011-05-30 17:15:59 +02:00
|
|
|
finished=0
|
|
|
|
|
|
|
|
while [ $finished -eq 0 ]; do
|
|
|
|
option=$1
|
|
|
|
|
|
|
|
case "$option" in
|
|
|
|
-*)
|
|
|
|
option=${option#-}
|
|
|
|
|
|
|
|
while [ -n "$option" ]; do
|
|
|
|
case $option in
|
|
|
|
h)
|
|
|
|
usage 0
|
|
|
|
;;
|
|
|
|
v)
|
|
|
|
echo "Shorewall Firewall Installer Version $VERSION"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
s*)
|
|
|
|
SPARSE=Yes
|
|
|
|
option=${option#s}
|
|
|
|
;;
|
2011-06-07 00:40:21 +02:00
|
|
|
a*)
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=Yes
|
2011-06-07 00:40:21 +02:00
|
|
|
option=${option#a}
|
|
|
|
;;
|
2011-05-30 17:15:59 +02:00
|
|
|
p*)
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=
|
2011-05-30 17:15:59 +02:00
|
|
|
option=${option#p}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift
|
2011-05-29 23:34:18 +02:00
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
2011-05-30 17:15:59 +02:00
|
|
|
[ -n "$option" ] && usage 1
|
|
|
|
finished=1
|
2008-12-07 19:17:26 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
|
|
|
|
|
|
|
#
|
|
|
|
# Determine where to install the firewall script
|
|
|
|
#
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -n "$DESTDIR" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -z "$CYGWIN" ]; then
|
|
|
|
if [ `id -u` != 0 ] ; then
|
|
|
|
echo "Not setting file owner/group permissions, not running as root."
|
|
|
|
OWNERSHIP=""
|
2009-02-22 18:19:19 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2009-07-25 16:30:08 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
install -d $OWNERSHIP -m 755 ${DESTDIR}/sbin
|
|
|
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${DEST}
|
2010-06-07 18:16:56 +02:00
|
|
|
|
2009-07-25 16:30:08 +02:00
|
|
|
CYGWIN=
|
2010-05-06 17:17:17 +02:00
|
|
|
MAC=
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2009-08-09 17:33:22 +02:00
|
|
|
#
|
|
|
|
# Verify that Perl is installed
|
|
|
|
#
|
|
|
|
if ! perl -c Perl/compiler.pl; then
|
|
|
|
echo "ERROR: Shorewall $VERSION requires Perl which either is not installed or is not able to compile the Shorewall perl code" >&2
|
|
|
|
echo " Try perl -c $PWD/Perl/compiler.pl" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2010-02-28 18:15:11 +01:00
|
|
|
if [ -n "$CYGWIN" ]; then
|
|
|
|
echo "Installing Cygwin-specific configuration..."
|
2010-05-06 17:17:17 +02:00
|
|
|
elif [ -n "$MAC" ]; then
|
2010-06-07 18:16:56 +02:00
|
|
|
echo "Installing Mac-specific configuration..."
|
2010-02-28 18:15:11 +01:00
|
|
|
else
|
2009-10-22 01:12:02 +02:00
|
|
|
if [ -f /etc/debian_version ]; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing Debian-specific configuration..."
|
2008-12-07 19:17:26 +01:00
|
|
|
DEBIAN=yes
|
2010-02-28 18:15:11 +01:00
|
|
|
SPARSE=yes
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -f /etc/slackware-version ] ; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing Slackware-specific configuration..."
|
2008-12-07 19:17:26 +01:00
|
|
|
DEST="/etc/rc.d"
|
2009-02-22 18:19:19 +01:00
|
|
|
MANDIR="/usr/man"
|
|
|
|
SLACKWARE=yes
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -f /etc/arch-release ] ; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing ArchLinux-specific configuration..."
|
2008-12-07 19:17:26 +01:00
|
|
|
DEST="/etc/rc.d"
|
|
|
|
INIT="shorewall"
|
|
|
|
ARCHLINUX=yes
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Change to the directory containing this script
|
|
|
|
#
|
|
|
|
cd "$(dirname $0)"
|
|
|
|
|
2010-01-19 17:28:08 +01:00
|
|
|
echo "Installing Shorewall Version $VERSION"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
2010-04-07 22:16:16 +02:00
|
|
|
# Check for /sbin/shorewall
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -f ${DESTDIR}/sbin/shorewall ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
first_install=""
|
|
|
|
else
|
|
|
|
first_install="Yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CYGWIN" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file shorewall ${DESTDIR}/sbin/shorewall 0755
|
|
|
|
echo "shorewall control program installed in ${DESTDIR}/sbin/shorewall"
|
2011-04-17 20:20:26 +02:00
|
|
|
|
|
|
|
if [ -z "$MAC" ]; then
|
|
|
|
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/shorewall
|
|
|
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/shorewall
|
|
|
|
else
|
|
|
|
eval sed -i -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/shorewall
|
|
|
|
eval sed -i -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/shorewall
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file shorewall ${DESTDIR}/bin/shorewall 0755
|
|
|
|
echo "shorewall control program installed in ${DESTDIR}/bin/shorewall"
|
2011-04-03 18:56:30 +02:00
|
|
|
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/bin/shorewall
|
|
|
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/bin/shorewall
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.debian.sh ${DESTDIR}/etc/init.d/shorewall 0544
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -n "$ARCHLINUX" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544
|
2009-02-22 18:19:19 +01:00
|
|
|
elif [ -n "$SLACKWARE" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.slackware.firewall.sh ${DESTDIR}${DEST}/rc.firewall 0644
|
|
|
|
install_file init.slackware.shorewall.sh ${DESTDIR}${DEST}/rc.shorewall 0644
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -n "$INIT" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$INIT" ] && echo "Shorewall script installed in ${DESTDIR}${DEST}/$INIT"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
mkdir -p ${DESTDIR}/etc/shorewall
|
2011-04-17 20:20:26 +02:00
|
|
|
mkdir -p ${DESTDIR}${LIBEXEC}/shorewall
|
|
|
|
mkdir -p ${DESTDIR}${PERLLIB}/Shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
mkdir -p ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
mkdir -p ${DESTDIR}/var/lib/shorewall
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
chmod 755 ${DESTDIR}/etc/shorewall
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/shorewall
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-11-03 19:06:10 +01:00
|
|
|
|
2011-06-18 22:03:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -n "$DESTDIR" ]; then
|
|
|
|
mkdir -p ${DESTDIR}/etc/logrotate.d
|
|
|
|
chmod 755 ${DESTDIR}/etc/logrotate.d
|
2009-11-03 19:06:10 +01:00
|
|
|
fi
|
2010-06-07 18:16:56 +02:00
|
|
|
|
2011-06-12 18:45:50 +02:00
|
|
|
if [ -n "$ANNOTATED" ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
suffix=.annotated
|
2011-05-29 23:34:18 +02:00
|
|
|
else
|
2011-06-25 00:13:40 +02:00
|
|
|
suffix=
|
2011-05-29 23:34:18 +02:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ ! -f ${DESTDIR}/etc/shorewall/shorewall.conf ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf${suffix} ${DESTDIR}/etc/shorewall/shorewall.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
|
2010-05-24 01:10:36 +02:00
|
|
|
if [ -n "$DEBIAN" ]; then
|
2009-06-05 17:46:58 +02:00
|
|
|
#
|
|
|
|
# Make a Debian-like shorewall.conf
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}/etc/shorewall/shorewall.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Config file installed as ${DESTDIR}/etc/shorewall/shorewall.conf"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$ARCHLINUX" ] ; then
|
2010-06-01 15:42:11 +02:00
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall/shorewall.conf
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/zones ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/zones.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/zones ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/zones${suffix} ${DESTDIR}/etc/shorewall/zones
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Zones file installed as ${DESTDIR}/etc/shorewall/zones"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/compiler
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.accounting
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.actions
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.dynamiczones
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.maclist
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.nat
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.providers
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.proxyarp
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.tc
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.tcrules
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/lib.tunnels
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/prog.header
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/prog.footer
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install wait4ifup
|
|
|
|
#
|
|
|
|
|
2011-04-17 20:20:26 +02:00
|
|
|
install_file wait4ifup ${DESTDIR}${LIBEXEC}/shorewall/wait4ifup 0755
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
echo
|
2011-04-17 20:20:26 +02:00
|
|
|
echo "wait4ifup installed in ${DESTDIR}${LIBEXEC}/shorewall/wait4ifup"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install -m 0644 configfiles/policy ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install -m 0644 configfiles/policy.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/policy ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/policy${suffix} ${DESTDIR}/etc/shorewall/policy
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Policy file installed as ${DESTDIR}/etc/shorewall/policy"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/interfaces ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/interfaces.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/interfaces ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/interfaces${suffix} ${DESTDIR}/etc/shorewall/interfaces
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Interfaces file installed as ${DESTDIR}/etc/shorewall/interfaces"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the hosts file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/hosts ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/hosts.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/hosts ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/hosts${suffix} ${DESTDIR}/etc/shorewall/hosts
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Hosts file installed as ${DESTDIR}/etc/shorewall/hosts"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/rules ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/rules.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/rules ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/rules${suffix} ${DESTDIR}/etc/shorewall/rules
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Rules file installed as ${DESTDIR}/etc/shorewall/rules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the NAT file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/nat ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/nat.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/nat ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/nat${suffix} ${DESTDIR}/etc/shorewall/nat
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "NAT file installed as ${DESTDIR}/etc/shorewall/nat"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the NETMAP file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/netmap ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/netmap.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/netmap ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/netmap${suffix} ${DESTDIR}/etc/shorewall/netmap
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "NETMAP file installed as ${DESTDIR}/etc/shorewall/netmap"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/params ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/params.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -f ${DESTDIR}/etc/shorewall/params ]; then
|
|
|
|
chmod 0644 ${DESTDIR}/etc/shorewall/params
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/params${suffix} ${DESTDIR}/etc/shorewall/params
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Parameter file installed as ${DESTDIR}/etc/shorewall/params"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the proxy ARP file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/proxyarp ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/proxyarp.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/proxyarp ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/proxyarp${suffix} ${DESTDIR}/etc/shorewall/proxyarp
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Proxy ARP file installed as ${DESTDIR}/etc/shorewall/proxyarp"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Stopped Routing file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/routestopped ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/routestopped.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/routestopped ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/routestopped${suffix} ${DESTDIR}/etc/shorewall/routestopped
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Stopped Routing file installed as ${DESTDIR}/etc/shorewall/routestopped"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/maclist ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/maclist.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/maclist ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/maclist${suffix} ${DESTDIR}/etc/shorewall/maclist
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "MAC list file installed as ${DESTDIR}/etc/shorewall/maclist"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Masq file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/masq ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/masq.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/masq ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/masq${suffix} ${DESTDIR}/etc/shorewall/masq
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Masquerade file installed as ${DESTDIR}/etc/shorewall/masq"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-21 18:21:51 +01:00
|
|
|
# Install the Notrack file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/notrack ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/notrack.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-02-21 18:21:51 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/notrack ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/notrack${suffix} ${DESTDIR}/etc/shorewall/notrack
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Notrack file installed as ${DESTDIR}/etc/shorewall/notrack"
|
2009-02-21 18:21:51 +01:00
|
|
|
fi
|
|
|
|
#
|
2011-02-06 02:25:44 +01:00
|
|
|
# Install the Modules files
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2011-02-06 01:12:43 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 modules ${DESTDIR}/usr/share/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Modules file installed as ${DESTDIR}/usr/share/shorewall/modules"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2011-02-06 02:25:44 +01:00
|
|
|
for f in modules.*; do
|
2011-02-06 02:43:00 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 $f ${DESTDIR}/usr/share/shorewall/$f
|
2011-02-06 02:25:44 +01:00
|
|
|
echo "Module file $f installed as ${DESTDIR}/usr/share/shorewall/$f"
|
|
|
|
done
|
|
|
|
|
2010-01-21 18:53:28 +01:00
|
|
|
#
|
|
|
|
# Install the Module Helpers file
|
|
|
|
#
|
2011-02-06 01:12:43 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 helpers ${DESTDIR}/usr/share/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Helper modules file installed as ${DESTDIR}/usr/share/shorewall/helpers"
|
2010-01-21 18:53:28 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TC Rules file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcrules ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcrules.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcrules ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcrules${suffix} ${DESTDIR}/etc/shorewall/tcrules
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Rules file installed as ${DESTDIR}/etc/shorewall/tcrules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-01-18 16:39:36 +01:00
|
|
|
#
|
|
|
|
# Install the TC Interfaces file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcinterfaces ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcinterfaces.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcinterfaces ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcinterfaces${suffix} ${DESTDIR}/etc/shorewall/tcinterfaces
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Interfaces file installed as ${DESTDIR}/etc/shorewall/tcinterfaces"
|
2010-01-18 16:39:36 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TC Priority file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcpri ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcpri.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcpri ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcpri${suffix} ${DESTDIR}/etc/shorewall/tcpri
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Priority file installed as ${DESTDIR}/etc/shorewall/tcpri"
|
2010-01-18 16:39:36 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tos ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tos.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tos ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tos${suffix} ${DESTDIR}/etc/shorewall/tos
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TOS file installed as ${DESTDIR}/etc/shorewall/tos"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tunnels ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tunnels.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tunnels ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tunnels${suffix} ${DESTDIR}/etc/shorewall/tunnels
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Tunnels file installed as ${DESTDIR}/etc/shorewall/tunnels"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the blacklist file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/blacklist ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/blacklist.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/blacklist ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/blacklist${suffix} ${DESTDIR}/etc/shorewall/blacklist
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Blacklist file installed as ${DESTDIR}/etc/shorewall/blacklist"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-09-14 22:43:32 +02:00
|
|
|
# Install the findgw file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/findgw ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-09-14 22:43:32 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/findgw ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/findgw ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Find GW file installed as ${DESTDIR}/etc/shorewall/findgw"
|
2009-09-14 22:43:32 +02:00
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Delete the Routes file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
delete_file ${DESTDIR}/etc/shorewall/routes
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Delete the tcstart file
|
|
|
|
#
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/tcstart
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Delete the Limits Files
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/action.Limit
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/Limit
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Delete the xmodules file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall/xmodules
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/providers ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/providers.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/providers ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/providers${suffix} ${DESTDIR}/etc/shorewall/providers
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Providers file installed as ${DESTDIR}/etc/shorewall/providers"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/route_rules ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/route_rules.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/route_rules ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/route_rules${suffix} ${DESTDIR}/etc/shorewall/route_rules
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Routing rules file installed as ${DESTDIR}/etc/shorewall/route_rules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcclasses ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcclasses.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcclasses ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcclasses${suffix} ${DESTDIR}/etc/shorewall/tcclasses
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Classes file installed as ${DESTDIR}/etc/shorewall/tcclasses"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcdevices ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcdevices.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcdevices ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcdevices${suffix} ${DESTDIR}/etc/shorewall/tcdevices
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Devices file installed as ${DESTDIR}/etc/shorewall/tcdevices"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcfilters file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcfilters ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcfilters.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcfilters ]; then
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcfilters${suffix} ${DESTDIR}/etc/shorewall/tcfilters
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Filters file installed as ${DESTDIR}/etc/shorewall/tcfilters"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-09-07 16:56:11 +02:00
|
|
|
#
|
|
|
|
# Install the secmarks file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/secmarks ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/secmarks.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2010-09-07 16:56:11 +02:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/secmarks ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/secmarks${suffix} ${DESTDIR}/etc/shorewall/secmarks
|
2010-09-07 16:56:11 +02:00
|
|
|
echo "Secmarks file installed as ${DESTDIR}/etc/shorewall/secmarks"
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file configpath ${DESTDIR}/usr/share/shorewall/configpath 0644
|
|
|
|
echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall/configpath"
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the init file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/init ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/init ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/init ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Init file installed as ${DESTDIR}/etc/shorewall/init"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the initdone file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/initdone ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/initdone ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/initdone ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Initdone file installed as ${DESTDIR}/etc/shorewall/initdone"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the start file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/start ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/start ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/start ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Start file installed as ${DESTDIR}/etc/shorewall/start"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/stop ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/stop ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/stop ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Stop file installed as ${DESTDIR}/etc/shorewall/stop"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/stopped ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/stopped ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/stopped ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Stopped file installed as ${DESTDIR}/etc/shorewall/stopped"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the ECN file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/ecn ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/ecn.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/ecn ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/ecn${suffix} ${DESTDIR}/etc/shorewall/ecn
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "ECN file installed as ${DESTDIR}/etc/shorewall/ecn"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/accounting ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/accounting.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/accounting ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/accounting${suffix} ${DESTDIR}/etc/shorewall/accounting
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Accounting file installed as ${DESTDIR}/etc/shorewall/accounting"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-06-20 18:35:08 +02:00
|
|
|
# Install the private library file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/lib.private ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-06-20 18:35:08 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/lib.private ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/lib.private ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Private library file installed as ${DESTDIR}/etc/shorewall/lib.private"
|
2009-06-20 18:35:08 +02:00
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Started file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/started ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/started ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/started ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Started file installed as ${DESTDIR}/etc/shorewall/started"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-05 21:38:50 +01:00
|
|
|
# Install the Restored file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/restored ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-02-05 21:38:50 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/restored ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/restored ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Restored file installed as ${DESTDIR}/etc/shorewall/restored"
|
2009-02-05 21:38:50 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-05-20 02:11:31 +02:00
|
|
|
# Install the Clear file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/clear ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/clear ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/clear ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Clear file installed as ${DESTDIR}/etc/shorewall/clear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Isusable file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/isusable ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/isusable ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/isusable ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Isusable file installed as ${DESTDIR}/etc/shorewall/isusable"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refresh file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/refresh ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/refresh ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/refresh ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Refresh file installed as ${DESTDIR}/etc/shorewall/refresh"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refreshed file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/refreshed ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/refreshed ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/refreshed ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Refreshed file installed as ${DESTDIR}/etc/shorewall/refreshed"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tcclear file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcclear ${DESTDIR}/usr/share/shorewall/configfiles
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/tcclear ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcclear ${DESTDIR}/etc/shorewall
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Tcclear file installed as ${DESTDIR}/etc/shorewall/tcclear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
2010-10-01 18:15:58 +02:00
|
|
|
# Install the Scfilter file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 644 configfiles/scfilter ${DESTDIR}/usr/share/shorewall/configfiles
|
2010-10-01 18:15:58 +02:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/scfilter ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/scfilter ${DESTDIR}/etc/shorewall
|
2010-10-01 18:15:58 +02:00
|
|
|
echo "Scfilter file installed as ${DESTDIR}/etc/shorewall/scfilter"
|
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file actions.std ${DESTDIR}/usr/share/shorewall/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${DESTDIR}/usr/shared/shorewall/actions.std"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Actions file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/actions ${DESTDIR}/usr/share/shorewall/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/actions.annotated ${DESTDIR}/usr/share/shorewall/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall/actions ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/actions${suffix} ${DESTDIR}/etc/shorewall/actions
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Actions file installed as ${DESTDIR}/etc/shorewall/actions"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Makefiles
|
|
|
|
#
|
2010-08-07 19:56:15 +02:00
|
|
|
install_file Makefile-lite ${DESTDIR}/usr/share/shorewall/configfiles/Makefile 0644
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}/etc/shorewall
|
|
|
|
echo "Makefile installed as ${DESTDIR}/etc/shorewall/Makefile"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Action files
|
|
|
|
#
|
|
|
|
for f in action.* ; do
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Action ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
# Install the Macro files
|
|
|
|
#
|
2009-03-04 01:46:31 +01:00
|
|
|
cd Macros
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
for f in macro.* ; do
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
2009-03-04 01:46:31 +01:00
|
|
|
|
|
|
|
cd ..
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the libraries
|
|
|
|
#
|
|
|
|
for f in lib.* ; do
|
|
|
|
if [ -f $f ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
#
|
|
|
|
# Symbolically link 'functions' to lib.base
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
ln -sf lib.base ${DESTDIR}/usr/share/shorewall/functions
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2009-02-22 20:58:15 +01:00
|
|
|
# /usr/share/shorewall/Shorewall if needed
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
mkdir -p ${DESTDIR}/usr/share/shorewall/Shorewall
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/shorewall/Shorewall
|
2009-02-22 20:58:15 +01:00
|
|
|
#
|
2009-02-22 19:28:18 +01:00
|
|
|
# Install the Compiler
|
|
|
|
#
|
2009-03-04 23:45:07 +01:00
|
|
|
cd Perl
|
|
|
|
|
2011-04-17 20:20:26 +02:00
|
|
|
install_file compiler.pl ${DESTDIR}${LIBEXEC}/shorewall/compiler.pl 0755
|
2009-02-22 19:28:18 +01:00
|
|
|
|
|
|
|
echo
|
2011-04-17 20:20:26 +02:00
|
|
|
echo "Compiler installed in ${DESTDIR}${LIBEXEC}/shorewall/compiler.pl"
|
2009-02-22 19:28:18 +01:00
|
|
|
#
|
2010-11-07 01:04:17 +01:00
|
|
|
# Install the params file helper
|
|
|
|
#
|
2011-04-17 20:20:26 +02:00
|
|
|
install_file getparams ${DESTDIR}${LIBEXEC}/shorewall/getparams 0755
|
2010-11-07 01:04:17 +01:00
|
|
|
|
|
|
|
echo
|
2011-04-17 20:20:26 +02:00
|
|
|
echo "Params file helper installed in ${DESTDIR}${LIBEXEC}/shorewall/getparams"
|
2010-11-07 01:04:17 +01:00
|
|
|
#
|
2009-02-22 19:28:18 +01:00
|
|
|
# Install the libraries
|
|
|
|
#
|
|
|
|
for f in Shorewall/*.pm ; do
|
2011-04-17 20:20:26 +02:00
|
|
|
install_file $f ${DESTDIR}${PERLLIB}/$f 0644
|
|
|
|
echo "Module ${f%.*} installed as ${DESTDIR}${PERLLIB}/$f"
|
2009-02-22 19:28:18 +01:00
|
|
|
done
|
|
|
|
#
|
|
|
|
# Install the program skeleton files
|
|
|
|
#
|
|
|
|
for f in prog.* ; do
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file $f ${DESTDIR}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Program skeleton file ${f#*.} installed as ${DESTDIR}/usr/share/shorewall/$f"
|
2009-02-22 19:28:18 +01:00
|
|
|
done
|
2009-03-04 23:45:07 +01:00
|
|
|
|
|
|
|
cd ..
|
2009-02-22 19:28:18 +01:00
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Create the version file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "$VERSION" > ${DESTDIR}/usr/share/shorewall/version
|
|
|
|
chmod 644 ${DESTDIR}/usr/share/shorewall/version
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Remove and create the symbolic link to the init script
|
|
|
|
#
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
rm -f /usr/share/shorewall/init
|
|
|
|
ln -s ${DEST}/${INIT} /usr/share/shorewall/init
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Man Pages
|
|
|
|
#
|
|
|
|
|
2010-05-24 01:02:28 +02:00
|
|
|
if [ -d manpages ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-05-24 01:02:28 +02:00
|
|
|
cd manpages
|
2010-05-09 01:32:03 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-05-24 01:02:28 +02:00
|
|
|
for f in *.5; do
|
|
|
|
gzip -c $f > $f.gz
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man5/$f.gz
|
|
|
|
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
|
2010-05-24 01:02:28 +02:00
|
|
|
done
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-05-24 01:02:28 +02:00
|
|
|
for f in *.8; do
|
|
|
|
gzip -c $f > $f.gz
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
|
|
|
|
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
|
2010-05-24 01:02:28 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-05-24 01:02:28 +02:00
|
|
|
echo "Man Pages Installed"
|
|
|
|
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -d ${DESTDIR}/etc/logrotate.d ]; then
|
|
|
|
install_file logrotate ${DESTDIR}/etc/logrotate.d/shorewall 0644
|
|
|
|
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall"
|
2009-11-03 19:06:10 +01:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2009-10-01 16:37:30 +02:00
|
|
|
rm -rf /usr/share/shorewall-perl
|
|
|
|
rm -rf /usr/share/shorewall-shell
|
2011-04-17 20:20:26 +02:00
|
|
|
[ "$PERLLIB" != /usr/share/shorewall ] && rm -rf /usr/share/shorewall/Shorewall
|
2009-10-01 16:37:30 +02:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -n "$DEBIAN" ]; then
|
2010-05-24 01:02:28 +02:00
|
|
|
install_file default.debian /etc/default/shorewall 0644
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2010-10-13 17:42:35 +02:00
|
|
|
update-rc.d shorewall defaults
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "shorewall will start automatically at boot"
|
|
|
|
echo "Set startup=1 in /etc/default/shorewall to enable"
|
|
|
|
touch /var/log/shorewall-init.log
|
2010-02-27 20:48:39 +01:00
|
|
|
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
|
2008-12-07 19:17:26 +01: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
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Report Success
|
|
|
|
#
|
2010-01-19 17:28:08 +01:00
|
|
|
echo "shorewall Version $VERSION Installed"
|