2008-12-09 17:50:17 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
# Script to install Shoreline6 Firewall
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# 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-09 17:50:17 +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-06-29 20:36:04 +02:00
|
|
|
VERSION=4.4.21
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
usage() # $1 = exit status
|
|
|
|
{
|
|
|
|
ME=$(basename $0)
|
|
|
|
echo "usage: $ME"
|
|
|
|
echo " $ME -v"
|
|
|
|
echo " $ME -h"
|
2011-06-07 00:40:21 +02:00
|
|
|
echo " $ME -s"
|
|
|
|
echo " $ME -a"
|
2008-12-09 17:50:17 +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
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "WARNING: Unable to configure shorewall6 to start automatically at boot" >&2
|
2008-12-09 17:50:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
delete_file() # $1 = file to delete
|
|
|
|
{
|
|
|
|
rm -f $1
|
|
|
|
}
|
|
|
|
|
|
|
|
install_file() # $1 = source $2 = target $3 = mode
|
|
|
|
{
|
|
|
|
run_install $OWNERSHIP -m $3 $1 ${2}
|
|
|
|
}
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$DESTDIR" ] || DESTDIR="$PREFIX"
|
|
|
|
|
2008-12-09 17:50:17 +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
|
|
|
|
#
|
|
|
|
ARGS=""
|
|
|
|
|
|
|
|
if [ -z "$DEST" ] ; then
|
|
|
|
DEST="/etc/init.d"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$INIT" ] ; then
|
2008-12-09 21:15:57 +01:00
|
|
|
INIT="shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2011-06-12 18:45:50 +02:00
|
|
|
ANNOTATED=
|
2008-12-09 17:50:17 +01:00
|
|
|
DEBIAN=
|
|
|
|
CYGWIN=
|
2010-05-06 17:17:17 +02:00
|
|
|
MAC=
|
2009-02-22 21:37:47 +01:00
|
|
|
MANDIR=${MANDIR:-"/usr/share/man"}
|
2010-02-27 20:48:39 +01:00
|
|
|
SPARSE=
|
2010-05-09 01:32:03 +02:00
|
|
|
INSTALLD='-D'
|
2011-04-17 20:20:26 +02:00
|
|
|
[ -n "${LIBEXEC:=/usr/share}" ]
|
|
|
|
[ -n "${PERLLIB:=/usr/share/shorewall}" ]
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2011-05-14 14:31:19 +02:00
|
|
|
case "$LIBEXEC" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
LIBEXEC=/usr/${LIBEXEC}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$PERLLIB" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
PERLLIB=/usr/${PERLLIB}
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2008-12-09 17:50:17 +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-09 17:50:17 +01:00
|
|
|
OWNER=$(id -un)
|
|
|
|
GROUP=$(id -gn)
|
|
|
|
CYGWIN=Yes
|
2010-02-27 20:48:39 +01:00
|
|
|
SPARSE=Yes
|
2008-12-09 17:50:17 +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-09 01:32:03 +02:00
|
|
|
INSTALLD=
|
2010-05-06 17:17:17 +02:00
|
|
|
;;
|
2008-12-09 17:50:17 +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 "Shorewall6 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-09 17:50:17 +01:00
|
|
|
*)
|
2011-05-30 17:15:59 +02:00
|
|
|
[ -n "$option" ] && usage 1
|
|
|
|
finished=1
|
2008-12-09 17:50:17 +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-09 17:50:17 +01:00
|
|
|
if [ -z "$CYGWIN" ]; then
|
|
|
|
if [ `id -u` != 0 ] ; then
|
|
|
|
echo "Not setting file owner/group permissions, not running as root."
|
|
|
|
OWNERSHIP=""
|
|
|
|
fi
|
|
|
|
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}
|
2009-07-25 16:30:08 +02:00
|
|
|
|
|
|
|
CYGWIN=
|
2010-05-06 17:17:17 +02:00
|
|
|
MAC=
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
2009-02-26 16:26:06 +01:00
|
|
|
[ -x /usr/share/shorewall/compiler.pl ] || \
|
|
|
|
{ echo " ERROR: Shorewall >= 4.3.5 is not installed" >&2; exit 1; }
|
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
|
|
|
|
echo "Installing Mac-specific configuration..."
|
2010-02-28 18:15:11 +01:00
|
|
|
else
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing Debian-specific configuration..."
|
2008-12-09 17:50:17 +01:00
|
|
|
DEBIAN=yes
|
2010-02-28 18:15:11 +01:00
|
|
|
SPARSE=yes
|
2008-12-09 17:50:17 +01:00
|
|
|
elif [ -f /etc/slackware-version ] ; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing Slackware-specific configuration..."
|
2008-12-09 17:50:17 +01:00
|
|
|
DEST="/etc/rc.d"
|
2009-02-22 18:19:19 +01:00
|
|
|
SLACKWARE=yes
|
2008-12-09 17:50:17 +01:00
|
|
|
INIT="rc.firewall"
|
|
|
|
elif [ -f /etc/arch-release ] ; then
|
2010-02-28 18:15:11 +01:00
|
|
|
echo "Installing ArchLinux-specific configuration..."
|
2008-12-09 17:50:17 +01:00
|
|
|
DEST="/etc/rc.d"
|
2008-12-09 21:15:57 +01:00
|
|
|
INIT="shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
ARCHLINUX=yes
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Change to the directory containing this script
|
|
|
|
#
|
|
|
|
cd "$(dirname $0)"
|
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "Installing Shorewall6 Version $VERSION"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
2010-04-07 22:16:16 +02:00
|
|
|
# Check for /sbin/shorewall6
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -f ${DESTDIR}/sbin/shorewall6 ]; then
|
2008-12-09 17:50:17 +01:00
|
|
|
first_install=""
|
|
|
|
else
|
|
|
|
first_install="Yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CYGWIN" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file shorewall6 ${DESTDIR}/sbin/shorewall6 0755 ${DESTDIR}/var/lib/shorewall6-${VERSION}.bkout
|
2011-04-17 20:20:26 +02:00
|
|
|
if [ -z "$MAC" ]; then
|
|
|
|
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/shorewall6
|
|
|
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/shorewall6
|
|
|
|
else
|
|
|
|
eval sed -i -e \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/sbin/shorewall6
|
|
|
|
eval sed -i -e \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/sbin/shorewall6
|
|
|
|
fi
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "shorewall6 control program installed in ${DESTDIR}/sbin/shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file shorewall6 ${DESTDIR}/bin/shorewall6 0755 ${DESTDIR}/var/lib/shorewall6-${VERSION}.bkout
|
2011-04-03 18:56:30 +02:00
|
|
|
eval sed -i \'s\|g_libexec=.\*\|g_libexec=$LIBEXEC\|\' ${DESTDIR}/bin/shorewall6
|
|
|
|
eval sed -i \'s\|g_perllib=.\*\|g_perllib=$PERLLIB\|\' ${DESTDIR}/bin/shorewall6
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "shorewall6 control program installed in ${DESTDIR}/bin/shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.debian.sh /etc/init.d/shorewall6 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
|
2009-02-22 18:19:19 +01:00
|
|
|
elif [ -n "$SLACKWARE" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.slackware.shorewall6.sh ${DESTDIR}${DEST}/rc.shorewall6 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
|
2008-12-09 17:50:17 +01:00
|
|
|
elif [ -n "$ARCHLINUX" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.archlinux.sh ${DESTDIR}${DEST}/$INIT 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
|
2008-12-09 17:50:17 +01:00
|
|
|
elif [ -n "$INIT" ]; then
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file init.sh ${DESTDIR}${DEST}/$INIT 0544 ${DESTDIR}/usr/share/shorewall6-${VERSION}.bkout
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$INIT" ] && echo "Shorewall6 script installed in ${DESTDIR}${DEST}/$INIT"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
2010-10-01 18:31:11 +02:00
|
|
|
# Create /etc/shorewall, /usr/share/shorewall and /var/lib/shorewall6 if needed
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
mkdir -p ${DESTDIR}/etc/shorewall6
|
2011-04-17 20:20:26 +02:00
|
|
|
mkdir -p ${DESTDIR}${LIBEXEC}/shorewall6
|
|
|
|
mkdir -p ${DESTDIR}${PERLLIB}/
|
2010-06-01 15:42:11 +02:00
|
|
|
mkdir -p ${DESTDIR}/usr/share/shorewall6/configfiles
|
|
|
|
mkdir -p ${DESTDIR}/var/lib/shorewall6
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
chmod 755 ${DESTDIR}/etc/shorewall6
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/shorewall6
|
|
|
|
chmod 755 ${DESTDIR}/usr/share/shorewall6/configfiles
|
2009-11-03 19:06:10 +01:00
|
|
|
|
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-01 15:42:11 +02:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/compiler
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.accounting
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.actions
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.dynamiczones
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.maclist
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.nat
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.providers
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.proxyarp
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.tc
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.tcrules
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.tunnels
|
2010-09-12 19:07:07 +02:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/prog.header6
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/prog.footer6
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install wait4ifup
|
|
|
|
#
|
|
|
|
|
2011-04-17 20:20:26 +02:00
|
|
|
install_file wait4ifup ${DESTDIR}${LIBEXEC}/shorewall6/wait4ifup 0755
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
echo
|
2011-04-17 20:20:26 +02:00
|
|
|
echo "wait4ifup installed in ${DESTDIR}${LIBEXEC}/shorewall6/wait4ifup"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2011-05-29 23:34:18 +02:00
|
|
|
#
|
|
|
|
# Install the Modules file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 modules ${DESTDIR}/usr/share/shorewall6/modules
|
|
|
|
echo "Modules file installed as ${DESTDIR}/usr/share/shorewall6/modules"
|
|
|
|
|
|
|
|
for f in modules.*; do
|
|
|
|
run_install $OWNERSHIP -m 0644 $f ${DESTDIR}/usr/share/shorewall6/$f
|
|
|
|
echo "Modules file $f installed as ${DESTDIR}/usr/share/shorewall6/$f"
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Module Helpers file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 helpers ${DESTDIR}/usr/share/shorewall6/helpers
|
|
|
|
echo "Helper modules file installed as ${DESTDIR}/usr/share/shorewall6/helpers"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
|
|
|
install_file configpath ${DESTDIR}/usr/share/shorewall6/configpath 0644
|
|
|
|
echo "Default config path file installed as ${DESTDIR}/usr/share/shorewall6/configpath"
|
|
|
|
#
|
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
|
|
|
install_file actions.std ${DESTDIR}/usr/share/shorewall6/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${DESTDIR}/usr/shared/shorewall6/actions.std"
|
|
|
|
|
2011-06-25 06:16:55 +02:00
|
|
|
cd configfiles
|
2011-06-18 22:03:55 +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
|
2011-06-25 00:13:40 +02:00
|
|
|
|
2011-06-07 00:40:21 +02:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 shorewall6.conf ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 shorewall6.conf.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
|
2011-06-07 00:40:21 +02:00
|
|
|
|
|
|
|
if [ ! -f ${DESTDIR}/etc/shorewall6/shorewall6.conf ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 shorewall6.conf${suffix} ${DESTDIR}/etc/shorewall6/shorewall6.conf
|
2011-06-07 00:40:21 +02:00
|
|
|
|
|
|
|
if [ -n "$DEBIAN" ] && mywhich perl; then
|
|
|
|
#
|
|
|
|
# Make a Debian-like shorewall6.conf
|
|
|
|
#
|
|
|
|
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}/etc/shorewall6/shorewall6.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Config file installed as ${DESTDIR}/etc/shorewall6/shorewall6.conf"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$ARCHLINUX" ] ; then
|
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}/etc/shorewall6/shorewall6.conf
|
|
|
|
fi
|
|
|
|
|
2011-05-29 23:34:18 +02:00
|
|
|
#
|
|
|
|
# Install the init file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 init ${DESTDIR}/usr/share/shorewall6/configfiles/init
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/init ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 init ${DESTDIR}/etc/shorewall6/init
|
|
|
|
echo "Init file installed as ${DESTDIR}/etc/shorewall6/init"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 zones ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 zones.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2011-05-29 23:34:18 +02:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/zones ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 zones${suffix} ${DESTDIR}/etc/shorewall6/zones
|
2011-05-29 23:34:18 +02:00
|
|
|
echo "Zones file installed as ${DESTDIR}/etc/shorewall6/zones"
|
|
|
|
fi
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 policy ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 policy.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/policy ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 policy${suffix} ${DESTDIR}/etc/shorewall6/policy
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Policy file installed as ${DESTDIR}/etc/shorewall6/policy"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 interfaces ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 interfaces.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/interfaces ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 interfaces${suffix} ${DESTDIR}/etc/shorewall6/interfaces
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Interfaces file installed as ${DESTDIR}/etc/shorewall6/interfaces"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the hosts file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 hosts ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 hosts.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/hosts ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 hosts${suffix} ${DESTDIR}/etc/shorewall6/hosts
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Hosts file installed as ${DESTDIR}/etc/shorewall6/hosts"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 rules ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 rules.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/rules ]; then
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 rules${suffix} ${DESTDIR}/etc/shorewall6/rules
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Rules file installed as ${DESTDIR}/etc/shorewall6/rules"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 params.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -f ${DESTDIR}/etc/shorewall6/params ]; then
|
|
|
|
chmod 0644 ${DESTDIR}/etc/shorewall6/params
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 params${suffix} ${DESTDIR}/etc/shorewall6/params
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Parameter file installed as ${DESTDIR}/etc/shorewall6/params"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Stopped Routing file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 routestopped ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 routestopped.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/routestopped ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 routestopped${suffix} ${DESTDIR}/etc/shorewall6/routestopped
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Stopped Routing file installed as ${DESTDIR}/etc/shorewall6/routestopped"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 maclist ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 maclist.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/maclist ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 maclist${suffix} ${DESTDIR}/etc/shorewall6/maclist
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "MAC list file installed as ${DESTDIR}/etc/shorewall6/maclist"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
2011-06-25 06:16:55 +02:00
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the TC Rules file
|
|
|
|
#
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcrules ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcrules.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcrules ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcrules${suffix} ${DESTDIR}/etc/shorewall6/tcrules
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Rules file installed as ${DESTDIR}/etc/shorewall6/tcrules"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2010-01-18 01:18:44 +01:00
|
|
|
#
|
|
|
|
# Install the TC Interfaces file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcinterfaces ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcinterfaces.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2010-01-18 01:18:44 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcinterfaces ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcinterfaces${suffix} ${DESTDIR}/etc/shorewall6/tcinterfaces
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Interfaces file installed as ${DESTDIR}/etc/shorewall6/tcinterfaces"
|
2010-01-18 01:18:44 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TC Priority file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcpri ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcpri.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2010-01-18 01:18:44 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcpri ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcpri${suffix} ${DESTDIR}/etc/shorewall6/tcpri
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Priority file installed as ${DESTDIR}/etc/shorewall6/tcpri"
|
2010-01-18 01:18:44 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tos ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tos.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tos ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tos${suffix} ${DESTDIR}/etc/shorewall6/tos
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TOS file installed as ${DESTDIR}/etc/shorewall6/tos"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tunnels ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tunnels.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tunnels ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tunnels${suffix} ${DESTDIR}/etc/shorewall6/tunnels
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Tunnels file installed as ${DESTDIR}/etc/shorewall6/tunnels"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the blacklist file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 blacklist ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 blacklist.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/blacklist ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 blacklist${suffix} ${DESTDIR}/etc/shorewall6/blacklist
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Blacklist file installed as ${DESTDIR}/etc/shorewall6/blacklist"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 providers ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 providers.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/providers ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 providers${suffix} ${DESTDIR}/etc/shorewall6/providers
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Providers file installed as ${DESTDIR}/etc/shorewall6/providers"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 route_rules ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 route_rules.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/route_rules ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 route_rules${suffix} ${DESTDIR}/etc/shorewall6/route_rules
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Routing rules file installed as ${DESTDIR}/etc/shorewall6/route_rules"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcclasses ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcclasses${suffix} ${DESTDIR}/etc/shorewall6/tcclasses
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Classes file installed as ${DESTDIR}/etc/shorewall6/tcclasses"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcdevices ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcdevices${suffix} ${DESTDIR}/etc/shorewall6/tcdevices
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "TC Devices file installed as ${DESTDIR}/etc/shorewall6/tcdevices"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2011-02-03 17:40:39 +01:00
|
|
|
#
|
|
|
|
# Install the tcfilters file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcfilters ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcfilters.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2011-02-03 17:40:39 +01:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcfilters ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcfilters${suffix} ${DESTDIR}/etc/shorewall6/tcfilters
|
2011-02-03 17:40:39 +01:00
|
|
|
echo "TC Filters file installed as ${DESTDIR}/etc/shorewall6/tcfilters"
|
|
|
|
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 notrack ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 notrack.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2009-02-21 18:21:51 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/notrack ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 notrack${suffix} ${DESTDIR}/etc/shorewall6/notrack
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Notrack file installed as ${DESTDIR}/etc/shorewall6/notrack"
|
2009-02-21 18:21:51 +01:00
|
|
|
fi
|
2010-09-07 16:56:11 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Secmarks file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 secmarks ${DESTDIR}/usr/share/shorewall6/configfiles/secmarks
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/secmarks ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 secmarks ${DESTDIR}/etc/shorewall6/secmarks
|
|
|
|
echo "Secmarks file installed as ${DESTDIR}/etc/shorewall6/secmarks"
|
|
|
|
fi
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the start file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 start ${DESTDIR}/usr/share/shorewall6/configfiles/start
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/start ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 start ${DESTDIR}/etc/shorewall6/start
|
|
|
|
echo "Start file installed as ${DESTDIR}/etc/shorewall6/start"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 stop ${DESTDIR}/usr/share/shorewall6/configfiles/stop
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/stop ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stop ${DESTDIR}/etc/shorewall6/stop
|
|
|
|
echo "Stop file installed as ${DESTDIR}/etc/shorewall6/stop"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 stopped ${DESTDIR}/usr/share/shorewall6/configfiles/stopped
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/stopped ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stopped ${DESTDIR}/etc/shorewall6/stopped
|
|
|
|
echo "Stopped file installed as ${DESTDIR}/etc/shorewall6/stopped"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 accounting ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 accounting.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/accounting ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 accounting${suffix} ${DESTDIR}/etc/shorewall6/accounting
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Accounting file installed as ${DESTDIR}/etc/shorewall6/accounting"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Started file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 started ${DESTDIR}/usr/share/shorewall6/configfiles/started
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/started ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 started ${DESTDIR}/etc/shorewall6/started
|
|
|
|
echo "Started file installed as ${DESTDIR}/etc/shorewall6/started"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-05 21:38:50 +01:00
|
|
|
# Install the Restored file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 restored ${DESTDIR}/usr/share/shorewall6/configfiles/restored
|
2009-02-05 21:38:50 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/restored ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 restored ${DESTDIR}/etc/shorewall6/restored
|
|
|
|
echo "Restored file installed as ${DESTDIR}/etc/shorewall6/restored"
|
2009-02-05 21:38:50 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-05-20 22:40:42 +02:00
|
|
|
# Install the Clear file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 clear ${DESTDIR}/usr/share/shorewall6/configfiles/clear
|
2009-05-20 22:40:42 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/clear ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 clear ${DESTDIR}/etc/shorewall6/clear
|
|
|
|
echo "Clear file installed as ${DESTDIR}/etc/shorewall6/clear"
|
2009-05-20 22:40:42 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Isusable file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}/usr/share/shorewall6/configfiles/isusable
|
2009-05-20 22:40:42 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/isusable ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 isusable ${DESTDIR}/etc/shorewall6/isusable
|
|
|
|
echo "Isusable file installed as ${DESTDIR}/etc/shorewall/isusable"
|
2009-05-20 22:40:42 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refresh file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 refresh ${DESTDIR}/usr/share/shorewall6/configfiles/refresh
|
2009-05-20 22:40:42 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/refresh ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 refresh ${DESTDIR}/etc/shorewall6/refresh
|
|
|
|
echo "Refresh file installed as ${DESTDIR}/etc/shorewall6/refresh"
|
2009-05-20 22:40:42 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refreshed file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 refreshed ${DESTDIR}/usr/share/shorewall6/configfiles/refreshed
|
2009-05-20 22:40:42 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/refreshed ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 refreshed ${DESTDIR}/etc/shorewall6/refreshed
|
|
|
|
echo "Refreshed file installed as ${DESTDIR}/etc/shorewall6/refreshed"
|
2009-05-20 22:40:42 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tcclear file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclear ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2009-05-20 22:40:42 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/tcclear ]; then
|
2011-06-25 06:16:55 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcclear ${DESTDIR}/etc/shorewall6/tcclear
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Tcclear file installed as ${DESTDIR}/etc/shorewall6/tcclear"
|
2009-05-20 22:40:42 +02:00
|
|
|
fi
|
|
|
|
#
|
2010-10-01 18:15:58 +02:00
|
|
|
# Install the Scfilter file
|
|
|
|
#
|
2010-12-11 19:04:07 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 scfilter ${DESTDIR}/usr/share/shorewall6/configfiles/scfilter
|
2010-10-01 18:15:58 +02:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/scfilter ]; then
|
2010-10-01 19:59:15 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 scfilter ${DESTDIR}/etc/shorewall6/scfilter
|
2010-10-01 18:15:58 +02:00
|
|
|
echo "Scfilter file installed as ${DESTDIR}/etc/shorewall6/scfilter"
|
|
|
|
fi
|
2010-12-11 19:04:07 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 providers ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 providers.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2010-12-11 19:04:07 +01:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/providers ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 providers${suffix} ${DESTDIR}/etc/shorewall6/providers
|
2010-12-11 19:04:07 +01:00
|
|
|
echo "Providers file installed as ${DESTDIR}/etc/shorewall6/providers"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Proxyndp file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 proxyndp ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyndp.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2010-12-11 19:04:07 +01:00
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/proxyndp ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 proxyndp${suffix} ${DESTDIR}/etc/shorewall6/proxyndp
|
2010-12-11 19:04:07 +01:00
|
|
|
echo "Proxyndp file installed as ${DESTDIR}/etc/shorewall6/proxyndp"
|
|
|
|
fi
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the Actions file
|
|
|
|
#
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 actions ${DESTDIR}/usr/share/shorewall6/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 actions.annotated ${DESTDIR}/usr/share/shorewall6/configfiles/
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}/etc/shorewall6/actions ]; then
|
2011-06-25 00:13:40 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 actions${suffix} ${DESTDIR}/etc/shorewall6/actions
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "Actions file installed as ${DESTDIR}/etc/shorewall6/actions"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2011-05-29 23:34:18 +02:00
|
|
|
cd ..
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the Makefiles
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 Makefile-lite ${DESTDIR}/usr/share/shorewall6/configfiles/Makefile
|
2008-12-09 17:50:17 +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/shorewall6/Makefile
|
|
|
|
echo "Makefile installed as ${DESTDIR}/etc/shorewall6/Makefile"
|
2008-12-09 17:50:17 +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/shorewall6/$f 0644
|
|
|
|
echo "Action ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6/$f"
|
2008-12-09 17:50:17 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
# Install the Macro files
|
|
|
|
#
|
|
|
|
for f in macro.* ; do
|
2010-06-01 15:42:11 +02:00
|
|
|
install_file $f ${DESTDIR}/usr/share/shorewall6/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6/$f"
|
2008-12-09 17:50:17 +01:00
|
|
|
done
|
|
|
|
#
|
|
|
|
# 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/shorewall6/$f 0644
|
|
|
|
echo "Library ${f#*.} file installed as ${DESTDIR}/usr/share/shorewall6/$f"
|
2008-12-09 17:50:17 +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/shorewall6/functions
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Create the version file
|
|
|
|
#
|
2010-06-01 15:42:11 +02:00
|
|
|
echo "$VERSION" > ${DESTDIR}/usr/share/shorewall6/version
|
|
|
|
chmod 644 ${DESTDIR}/usr/share/shorewall6/version
|
2008-12-09 17:50:17 +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-09 21:15:57 +01:00
|
|
|
rm -f /usr/share/shorewall6/init
|
|
|
|
ln -s ${DEST}/${INIT} /usr/share/shorewall6/init
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Man Pages
|
|
|
|
#
|
|
|
|
|
2008-12-14 19:08:56 +01:00
|
|
|
cd manpages
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
|
2010-05-09 01:32:03 +02:00
|
|
|
|
2008-12-14 19:08:56 +01: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"
|
2008-12-14 19:08:56 +01:00
|
|
|
done
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-14 19:08:56 +01: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"
|
2008-12-14 19:08:56 +01:00
|
|
|
done
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-14 19:08:56 +01:00
|
|
|
cd ..
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-14 19:08:56 +01:00
|
|
|
echo "Man Pages Installed"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -d ${DESTDIR}/etc/logrotate.d ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}/etc/logrotate.d/shorewall6
|
|
|
|
echo "Logrotate file installed as ${DESTDIR}/etc/logrotate.d/shorewall6"
|
2009-11-03 19:06:10 +01:00
|
|
|
fi
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ -n "$DEBIAN" ]; then
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall6
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2010-10-13 17:42:35 +02:00
|
|
|
update-rc.d shorewall6 defaults
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "shorewall6 will start automatically at boot"
|
|
|
|
echo "Set startup=1 in /etc/default/shorewall6 to enable"
|
|
|
|
touch /var/log/shorewall6-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/shorewall6/shorewall6.conf
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
|
|
|
if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then
|
2008-12-09 21:15:57 +01:00
|
|
|
if insserv /etc/init.d/shorewall6 ; then
|
|
|
|
echo "shorewall6 will start automatically at boot"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/shorewall6/shorewall6.conf to enable"
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then
|
2008-12-09 21:15:57 +01:00
|
|
|
if chkconfig --add shorewall6 ; then
|
|
|
|
echo "shorewall6 will start automatically in run levels as follows:"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/shorewall6/shorewall6.conf to enable"
|
|
|
|
chkconfig --list shorewall6
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ -x /sbin/rc-update ]; then
|
2008-12-09 21:15:57 +01:00
|
|
|
if rc-update add shorewall6 default; then
|
|
|
|
echo "shorewall6 will start automatically at boot"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in /etc/shorewall6/shorewall6.conf to enable"
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Report Success
|
|
|
|
#
|
2010-01-22 19:59:05 +01:00
|
|
|
echo "shorewall6 Version $VERSION Installed"
|