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]
|
|
|
|
#
|
2010-01-01 21:58:27 +01:00
|
|
|
# (c) 2000,2001,2002,2003,2004,2005,2006,2007,2009,2009,2010 - 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.
|
|
|
|
#
|
|
|
|
|
2010-05-09 19:40:32 +02:00
|
|
|
VERSION=4.4.9.1
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
usage() # $1 = exit status
|
|
|
|
{
|
|
|
|
ME=$(basename $0)
|
|
|
|
echo "usage: $ME"
|
|
|
|
echo " $ME -v"
|
|
|
|
echo " $ME -h"
|
|
|
|
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
|
|
|
|
{
|
2009-03-04 00:38:56 +01:00
|
|
|
run_install $OWNERSHIP -m $3 $1 ${2}
|
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
|
|
|
|
# RUNLEVELS is the chkconfig parmeters for firewall
|
|
|
|
# ARGS is "yes" if we've already parsed an argument
|
|
|
|
#
|
|
|
|
ARGS=""
|
|
|
|
|
|
|
|
if [ -z "$DEST" ] ; then
|
|
|
|
DEST="/etc/init.d"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$INIT" ] ; then
|
|
|
|
INIT="shorewall"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$RUNLEVELS" ] ; then
|
|
|
|
RUNLEVELS=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
DEBIAN=
|
|
|
|
CYGWIN=
|
2010-05-06 17:17:17 +02:00
|
|
|
MAC=
|
2010-02-27 20:48:39 +01:00
|
|
|
SPARSE=
|
2009-02-22 18:19:19 +01:00
|
|
|
MANDIR=${MANDIR:-"/usr/share/man"}
|
2010-05-06 20:23:14 +02:00
|
|
|
INSTALLD='-D'
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
case $(uname) in
|
|
|
|
CYGWIN*)
|
2009-07-25 16:44:53 +02:00
|
|
|
if [ -z "$PREFIX" ]; then
|
|
|
|
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)
|
|
|
|
if [ -z "$PREFIX" ]; then
|
|
|
|
DEST=
|
|
|
|
INIT=
|
2010-05-08 22:35:21 +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-06 20:23:14 +02:00
|
|
|
INSTALLD=
|
2010-05-06 17:17:17 +02:00
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=root
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
|
|
|
|
|
|
|
while [ $# -gt 0 ] ; do
|
|
|
|
case "$1" in
|
|
|
|
-h|help|?)
|
|
|
|
usage 0
|
|
|
|
;;
|
|
|
|
-v)
|
|
|
|
echo "Shorewall Firewall Installer Version $VERSION"
|
|
|
|
exit 0
|
|
|
|
;;
|
2010-02-27 20:48:39 +01:00
|
|
|
-s)
|
|
|
|
SPARSE=Yes
|
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
|
|
|
usage 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
ARGS="yes"
|
|
|
|
done
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
|
|
|
|
|
|
|
#
|
|
|
|
# Determine where to install the firewall script
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ -n "$PREFIX" ]; then
|
|
|
|
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
|
|
|
|
|
|
|
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
|
|
|
|
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
|
|
|
|
|
|
|
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
|
|
|
|
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-04-07 22:16:16 +02:00
|
|
|
if [ -f ${PREFIX}/sbin/shorewall ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
first_install=""
|
|
|
|
else
|
|
|
|
first_install="Yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CYGWIN" ]; then
|
2009-03-04 23:52:05 +01:00
|
|
|
install_file shorewall ${PREFIX}/sbin/shorewall 0755
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "shorewall control program installed in ${PREFIX}/sbin/shorewall"
|
|
|
|
else
|
2009-03-04 23:52:05 +01:00
|
|
|
install_file shorewall ${PREFIX}/bin/shorewall 0755
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "shorewall control program installed in ${PREFIX}/bin/shorewall"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
install_file init.debian.sh /etc/init.d/shorewall 0544
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -n "$ARCHLINUX" ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544
|
2009-02-22 18:19:19 +01:00
|
|
|
elif [ -n "$SLACKWARE" ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
install_file init.slackware.firewall.sh ${PREFIX}${DEST}/rc.firewall 0644
|
|
|
|
install_file init.slackware.shorewall.sh ${PREFIX}${DEST}/rc.shorewall 0644
|
2008-12-07 19:17:26 +01:00
|
|
|
elif [ -n "$INIT" ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
install_file init.sh ${PREFIX}${DEST}/$INIT 0544
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-05-06 17:17:17 +02:00
|
|
|
[ -n "$INIT" ] && echo "Shorewall script installed in ${PREFIX}${DEST}/$INIT"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed
|
|
|
|
#
|
|
|
|
mkdir -p ${PREFIX}/etc/shorewall
|
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall
|
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall/configfiles
|
|
|
|
mkdir -p ${PREFIX}/var/lib/shorewall
|
|
|
|
|
|
|
|
chmod 755 ${PREFIX}/etc/shorewall
|
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall
|
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall/configfiles
|
2009-11-03 19:06:10 +01:00
|
|
|
|
|
|
|
if [ -n "$PREFIX" ]; then
|
|
|
|
mkdir -p ${PREFIX}/etc/logrotate.d
|
|
|
|
chmod 755 ${PREFIX}/etc/logrotate.d
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2009-08-09 17:33:22 +02:00
|
|
|
perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall/configfiles:/usr/share/shorewall|;' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf
|
2010-04-15 18:39:21 +02:00
|
|
|
perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall-lite-init.log|;' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall/shorewall.conf ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/etc/shorewall/shorewall.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
|
|
|
|
if [ -n "$DEBIAN" ] && mywhich perl; then
|
|
|
|
#
|
|
|
|
# Make a Debian-like shorewall.conf
|
|
|
|
#
|
2010-04-19 22:08:03 +02:00
|
|
|
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${PREFIX}/etc/shorewall/shorewall.conf
|
2009-06-05 17:46:58 +02:00
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Config file installed as ${PREFIX}/etc/shorewall/shorewall.conf"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$ARCHLINUX" ] ; then
|
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall/shorewall.conf
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/zones ${PREFIX}/usr/share/shorewall/configfiles/zones
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/zones ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0744 configfiles/zones ${PREFIX}/etc/shorewall/zones
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Zones file installed as ${PREFIX}/etc/shorewall/zones"
|
|
|
|
fi
|
|
|
|
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/compiler
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.accounting
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.actions
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.dynamiczones
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.maclist
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.nat
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.providers
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.proxyarp
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.tc
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.tcrules
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/lib.tunnels
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/prog.header
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/prog.footer
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install wait4ifup
|
|
|
|
#
|
|
|
|
|
|
|
|
install_file wait4ifup ${PREFIX}/usr/share/shorewall/wait4ifup 0755
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall/wait4ifup"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/policy ${PREFIX}/usr/share/shorewall/configfiles/policy
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/policy ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/policy ${PREFIX}/etc/shorewall/policy
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Policy file installed as ${PREFIX}/etc/shorewall/policy"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/interfaces ${PREFIX}/usr/share/shorewall/configfiles/interfaces
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/interfaces ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/interfaces ${PREFIX}/etc/shorewall/interfaces
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Interfaces file installed as ${PREFIX}/etc/shorewall/interfaces"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the hosts file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/hosts ${PREFIX}/usr/share/shorewall/configfiles/hosts
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/hosts ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/hosts ${PREFIX}/etc/shorewall/hosts
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Hosts file installed as ${PREFIX}/etc/shorewall/hosts"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/rules ${PREFIX}/usr/share/shorewall/configfiles/rules
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/rules ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/rules ${PREFIX}/etc/shorewall/rules
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Rules file installed as ${PREFIX}/etc/shorewall/rules"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the NAT file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/nat ${PREFIX}/usr/share/shorewall/configfiles/nat
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/nat ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/nat ${PREFIX}/etc/shorewall/nat
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "NAT file installed as ${PREFIX}/etc/shorewall/nat"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the NETMAP file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/netmap ${PREFIX}/usr/share/shorewall/configfiles/netmap
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/netmap ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/netmap ${PREFIX}/etc/shorewall/netmap
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "NETMAP file installed as ${PREFIX}/etc/shorewall/netmap"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/params ${PREFIX}/usr/share/shorewall/configfiles/params
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
if [ -f ${PREFIX}/etc/shorewall/params ]; then
|
|
|
|
chmod 0644 ${PREFIX}/etc/shorewall/params
|
|
|
|
else
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/params ${PREFIX}/etc/shorewall/params
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Parameter file installed as ${PREFIX}/etc/shorewall/params"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the proxy ARP file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/proxyarp ${PREFIX}/usr/share/shorewall/configfiles/proxyarp
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/proxyarp ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/proxyarp ${PREFIX}/etc/shorewall/proxyarp
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Proxy ARP file installed as ${PREFIX}/etc/shorewall/proxyarp"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Stopped Routing file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/routestopped ${PREFIX}/usr/share/shorewall/configfiles/routestopped
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/routestopped ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/routestopped ${PREFIX}/etc/shorewall/routestopped
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Stopped Routing file installed as ${PREFIX}/etc/shorewall/routestopped"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/maclist ${PREFIX}/usr/share/shorewall/configfiles/maclist
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/maclist ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/maclist ${PREFIX}/etc/shorewall/maclist
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "MAC list file installed as ${PREFIX}/etc/shorewall/maclist"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Masq file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/masq ${PREFIX}/usr/share/shorewall/configfiles/masq
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/masq ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/masq ${PREFIX}/etc/shorewall/masq
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Masquerade file installed as ${PREFIX}/etc/shorewall/masq"
|
|
|
|
fi
|
|
|
|
#
|
2009-02-21 18:21:51 +01:00
|
|
|
# Install the Notrack file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/notrack ${PREFIX}/usr/share/shorewall/configfiles/notrack
|
2009-02-21 18:21:51 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/notrack ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/notrack ${PREFIX}/etc/shorewall/notrack
|
2009-02-21 18:21:51 +01:00
|
|
|
echo "Notrack file installed as ${PREFIX}/etc/shorewall/notrack"
|
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Modules file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall/modules
|
|
|
|
echo "Modules file installed as ${PREFIX}/usr/share/shorewall/modules"
|
|
|
|
|
2010-01-21 18:53:28 +01:00
|
|
|
#
|
|
|
|
# Install the Module Helpers file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0600 helpers ${PREFIX}/usr/share/shorewall/helpers
|
|
|
|
echo "Helper modules file installed as ${PREFIX}/usr/share/shorewall/helpers"
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TC Rules file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcrules ${PREFIX}/usr/share/shorewall/configfiles/tcrules
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcrules ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcrules ${PREFIX}/etc/shorewall/tcrules
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "TC Rules file installed as ${PREFIX}/etc/shorewall/tcrules"
|
|
|
|
fi
|
|
|
|
|
2010-01-18 16:39:36 +01:00
|
|
|
#
|
|
|
|
# Install the TC Interfaces file
|
|
|
|
#
|
2010-01-18 18:20:09 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcinterfaces ${PREFIX}/usr/share/shorewall/configfiles/tcinterfaces
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcinterfaces ]; then
|
2010-01-18 18:29:14 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcinterfaces ${PREFIX}/etc/shorewall/tcinterfaces
|
2010-01-18 16:39:36 +01:00
|
|
|
echo "TC Interfaces file installed as ${PREFIX}/etc/shorewall/tcinterfaces"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TC Priority file
|
|
|
|
#
|
2010-01-18 18:20:09 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcpri ${PREFIX}/usr/share/shorewall/configfiles/tcpri
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcpri ]; then
|
2010-01-18 18:29:14 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcpri ${PREFIX}/etc/shorewall/tcpri
|
2010-01-18 16:39:36 +01:00
|
|
|
echo "TC Priority file installed as ${PREFIX}/etc/shorewall/tcpri"
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2009-03-04 02:20:52 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tos ${PREFIX}/usr/share/shorewall/configfiles/tos
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tos ]; then
|
2009-03-04 02:20:52 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tos ${PREFIX}/etc/shorewall/tos
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "TOS file installed as ${PREFIX}/etc/shorewall/tos"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tunnels ${PREFIX}/usr/share/shorewall/configfiles/tunnels
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tunnels ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tunnels ${PREFIX}/etc/shorewall/tunnels
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Tunnels file installed as ${PREFIX}/etc/shorewall/tunnels"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the blacklist file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/blacklist ${PREFIX}/usr/share/shorewall/configfiles/blacklist
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/blacklist ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/blacklist ${PREFIX}/etc/shorewall/blacklist
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Blacklist file installed as ${PREFIX}/etc/shorewall/blacklist"
|
|
|
|
fi
|
|
|
|
#
|
2009-09-14 22:43:32 +02:00
|
|
|
# Install the findgw file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/findgw ${PREFIX}/usr/share/shorewall/configfiles/findgw
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/findgw ]; then
|
2009-09-14 22:43:32 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/findgw ${PREFIX}/etc/shorewall/findgw
|
|
|
|
echo "Find GW file installed as ${PREFIX}/etc/shorewall/findgw"
|
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Delete the Routes file
|
|
|
|
#
|
|
|
|
delete_file ${PREFIX}/etc/shorewall/routes
|
|
|
|
#
|
|
|
|
# Delete the tcstart file
|
|
|
|
#
|
|
|
|
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/tcstart
|
|
|
|
|
|
|
|
#
|
|
|
|
# Delete the Limits Files
|
|
|
|
#
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/action.Limit
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/Limit
|
|
|
|
#
|
|
|
|
# Delete the xmodules file
|
|
|
|
#
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall/xmodules
|
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/providers ${PREFIX}/usr/share/shorewall/configfiles/providers
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/providers ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/providers ${PREFIX}/etc/shorewall/providers
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Providers file installed as ${PREFIX}/etc/shorewall/providers"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/route_rules ${PREFIX}/usr/share/shorewall/configfiles/route_rules
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/route_rules ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/route_rules ${PREFIX}/etc/shorewall/route_rules
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Routing rules file installed as ${PREFIX}/etc/shorewall/route_rules"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcclasses ${PREFIX}/usr/share/shorewall/configfiles/tcclasses
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcclasses ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcclasses ${PREFIX}/etc/shorewall/tcclasses
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "TC Classes file installed as ${PREFIX}/etc/shorewall/tcclasses"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcdevices ${PREFIX}/usr/share/shorewall/configfiles/tcdevices
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcdevices ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcdevices ${PREFIX}/etc/shorewall/tcdevices
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "TC Devices file installed as ${PREFIX}/etc/shorewall/tcdevices"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcfilters file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcfilters ${PREFIX}/usr/share/shorewall/configfiles/tcfilters
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcfilters ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcfilters ${PREFIX}/etc/shorewall/tcfilters
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "TC Filters file installed as ${PREFIX}/etc/shorewall/tcfilters"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
|
|
|
install_file configpath ${PREFIX}/usr/share/shorewall/configpath 0644
|
|
|
|
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall/configpath"
|
|
|
|
#
|
|
|
|
# Install the init file
|
|
|
|
#
|
2009-03-04 17:34:55 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/init ${PREFIX}/usr/share/shorewall/configfiles/init
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/init ]; then
|
2009-03-04 17:34:55 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/init ${PREFIX}/etc/shorewall/init
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Init file installed as ${PREFIX}/etc/shorewall/init"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the initdone file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/initdone ${PREFIX}/usr/share/shorewall/configfiles/initdone
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/initdone ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/initdone ${PREFIX}/etc/shorewall/initdone
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Initdone file installed as ${PREFIX}/etc/shorewall/initdone"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the start file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/start ${PREFIX}/usr/share/shorewall/configfiles/start
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/start ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/start ${PREFIX}/etc/shorewall/start
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Start file installed as ${PREFIX}/etc/shorewall/start"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/stop ${PREFIX}/usr/share/shorewall/configfiles/stop
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/stop ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/stop ${PREFIX}/etc/shorewall/stop
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Stop file installed as ${PREFIX}/etc/shorewall/stop"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/stopped ${PREFIX}/usr/share/shorewall/configfiles/stopped
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/stopped ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/stopped ${PREFIX}/etc/shorewall/stopped
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Stopped file installed as ${PREFIX}/etc/shorewall/stopped"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the ECN file
|
|
|
|
#
|
2009-03-04 02:26:23 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/ecn ${PREFIX}/usr/share/shorewall/configfiles/ecn
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/ecn ]; then
|
2009-03-04 02:26:23 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/ecn ${PREFIX}/etc/shorewall/ecn
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "ECN file installed as ${PREFIX}/etc/shorewall/ecn"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/accounting ${PREFIX}/usr/share/shorewall/configfiles/accounting
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/accounting ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/accounting ${PREFIX}/etc/shorewall/accounting
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Accounting file installed as ${PREFIX}/etc/shorewall/accounting"
|
|
|
|
fi
|
|
|
|
#
|
2009-06-20 18:35:08 +02:00
|
|
|
# Install the private library file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/lib.private ${PREFIX}/usr/share/shorewall/configfiles/lib.private
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/lib.private ]; then
|
2009-06-20 18:35:08 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/lib.private ${PREFIX}/etc/shorewall/lib.private
|
|
|
|
echo "Private library file installed as ${PREFIX}/etc/shorewall/lib.private"
|
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Started file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/started ${PREFIX}/usr/share/shorewall/configfiles/started
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/started ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/started ${PREFIX}/etc/shorewall/started
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Started file installed as ${PREFIX}/etc/shorewall/started"
|
|
|
|
fi
|
|
|
|
#
|
2009-02-05 21:38:50 +01:00
|
|
|
# Install the Restored file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/restored ${PREFIX}/usr/share/shorewall/configfiles/restored
|
2009-02-05 21:38:50 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/restored ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/restored ${PREFIX}/etc/shorewall/restored
|
2009-02-05 21:38:50 +01:00
|
|
|
echo "Restored file installed as ${PREFIX}/etc/shorewall/restored"
|
|
|
|
fi
|
|
|
|
#
|
2009-05-20 02:11:31 +02:00
|
|
|
# Install the Clear file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/clear ${PREFIX}/usr/share/shorewall/configfiles/clear
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/clear ]; then
|
2009-05-20 02:11:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/clear ${PREFIX}/etc/shorewall/clear
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Clear file installed as ${PREFIX}/etc/shorewall/clear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Isusable file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/isusable ${PREFIX}/usr/share/shorewall/configfiles/isusable
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/isusable ]; then
|
2009-05-20 02:11:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/isusable ${PREFIX}/etc/shorewall/isusable
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Isusable file installed as ${PREFIX}/etc/shorewall/isusable"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refresh file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/refresh ${PREFIX}/usr/share/shorewall/configfiles/refresh
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/refresh ]; then
|
2009-05-20 02:11:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/refresh ${PREFIX}/etc/shorewall/refresh
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Refresh file installed as ${PREFIX}/etc/shorewall/refresh"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refreshed file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/refreshed ${PREFIX}/usr/share/shorewall/configfiles/refreshed
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/refreshed ]; then
|
2009-05-20 02:11:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/refreshed ${PREFIX}/etc/shorewall/refreshed
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Refreshed file installed as ${PREFIX}/etc/shorewall/refreshed"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tcclear file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/tcclear ${PREFIX}/usr/share/shorewall/configfiles/tcclear
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/tcclear ]; then
|
2009-05-20 02:11:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 configfiles/tcclear ${PREFIX}/etc/shorewall/tcclear
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Tcclear file installed as ${PREFIX}/etc/shorewall/tcclear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
|
|
|
install_file actions.std ${PREFIX}/usr/share/shorewall/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${PREFIX}/usr/shared/shorewall/actions.std"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Actions file
|
|
|
|
#
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/actions ${PREFIX}/usr/share/shorewall/configfiles/actions
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${PREFIX}/etc/shorewall/actions ]; then
|
2009-03-04 02:15:51 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 configfiles/actions ${PREFIX}/etc/shorewall/actions
|
2008-12-07 19:17:26 +01:00
|
|
|
echo "Actions file installed as ${PREFIX}/etc/shorewall/actions"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Makefiles
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 Makefile-lite ${PREFIX}/usr/share/shorewall/configfiles/Makefile
|
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall/Makefile
|
|
|
|
echo "Makefile installed as ${PREFIX}/etc/shorewall/Makefile"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Action files
|
|
|
|
#
|
|
|
|
for f in action.* ; do
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Action ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f"
|
|
|
|
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
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f"
|
|
|
|
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
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall/$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
#
|
|
|
|
# Symbolically link 'functions' to lib.base
|
|
|
|
#
|
|
|
|
ln -sf lib.base ${PREFIX}/usr/share/shorewall/functions
|
|
|
|
#
|
2009-02-22 20:58:15 +01:00
|
|
|
# /usr/share/shorewall/Shorewall if needed
|
|
|
|
#
|
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall/Shorewall
|
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall/Shorewall
|
|
|
|
#
|
2009-02-22 19:28:18 +01:00
|
|
|
# Install the Compiler
|
|
|
|
#
|
2009-03-04 23:45:07 +01:00
|
|
|
cd Perl
|
|
|
|
|
2009-02-22 19:28:18 +01:00
|
|
|
install_file compiler.pl ${PREFIX}/usr/share/shorewall/compiler.pl 0755
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Compiler installed in ${PREFIX}/usr/share/shorewall/compiler.pl"
|
|
|
|
#
|
|
|
|
# Install the libraries
|
|
|
|
#
|
|
|
|
for f in Shorewall/*.pm ; do
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Module ${f%.*} installed as ${PREFIX}/usr/share/shorewall/$f"
|
|
|
|
done
|
|
|
|
#
|
|
|
|
# Install the program skeleton files
|
|
|
|
#
|
|
|
|
for f in prog.* ; do
|
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall/$f 0644
|
|
|
|
echo "Program skeleton file ${f#*.} installed as ${PREFIX}/usr/share/shorewall/$f"
|
|
|
|
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
|
|
|
|
#
|
|
|
|
echo "$VERSION" > ${PREFIX}/usr/share/shorewall/version
|
|
|
|
chmod 644 ${PREFIX}/usr/share/shorewall/version
|
|
|
|
#
|
|
|
|
# Remove and create the symbolic link to the init script
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ -z "$PREFIX" ]; then
|
|
|
|
rm -f /usr/share/shorewall/init
|
|
|
|
ln -s ${DEST}/${INIT} /usr/share/shorewall/init
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Man Pages
|
|
|
|
#
|
|
|
|
|
|
|
|
cd manpages
|
|
|
|
|
2010-05-06 20:23:14 +02:00
|
|
|
[ -n "$INSTALLD" ] || mkdir -p ${PREFIX}${MANDIR}/man5/ ${PREFIX}${MANDIR}/man8/
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
for f in *.5; do
|
|
|
|
gzip -c $f > $f.gz
|
2010-05-06 20:23:14 +02:00
|
|
|
run_install $INSTALLD -m 0644 $f.gz ${PREFIX}${MANDIR}/man5/$f.gz
|
2009-02-22 18:19:19 +01:00
|
|
|
echo "Man page $f.gz installed to ${PREFIX}${MANDIR}/man5/$f.gz"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
for f in *.8; do
|
|
|
|
gzip -c $f > $f.gz
|
2010-05-06 20:23:14 +02:00
|
|
|
run_install $INSTALLD -m 0644 $f.gz ${PREFIX}${MANDIR}/man8/$f.gz
|
2009-02-22 18:19:19 +01:00
|
|
|
echo "Man page $f.gz installed to ${PREFIX}${MANDIR}/man8/$f.gz"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo "Man Pages Installed"
|
|
|
|
|
2009-11-03 19:06:10 +01:00
|
|
|
if [ -d ${PREFIX}/etc/logrotate.d ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 logrotate ${PREFIX}/etc/logrotate.d/shorewall
|
|
|
|
echo "Logrotate file installed as ${PREFIX}/etc/logrotate.d/shorewall"
|
|
|
|
fi
|
|
|
|
|
2009-10-01 16:37:30 +02:00
|
|
|
if [ -z "$PREFIX" ]; then
|
|
|
|
rm -rf /usr/share/shorewall-perl
|
|
|
|
rm -rf /usr/share/shorewall-shell
|
|
|
|
fi
|
|
|
|
|
2010-05-06 17:17:17 +02:00
|
|
|
if [ -z "$PREFIX" -a -n "$first_install" -a -z "${CYGWIN}${MAC}" ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
if [ -n "$DEBIAN" ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall
|
|
|
|
ln -s ../init.d/shorewall /etc/rcS.d/S40shorewall
|
|
|
|
echo "shorewall will start automatically at boot"
|
|
|
|
echo "Set startup=1 in /etc/default/shorewall to enable"
|
|
|
|
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"
|