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]
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
# (c) 2000,2001,2002,2003,2004,2005,2008 - 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.
|
|
|
|
#
|
|
|
|
|
2009-11-27 21:29:11 +01:00
|
|
|
VERSION=4.4.5
|
2008-12-09 17:50:17 +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
|
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}
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
2008-12-09 21:15:57 +01:00
|
|
|
INIT="shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$RUNLEVELS" ] ; then
|
|
|
|
RUNLEVELS=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
DEBIAN=
|
|
|
|
CYGWIN=
|
2009-02-22 21:37:47 +01:00
|
|
|
MANDIR=${MANDIR:-"/usr/share/man"}
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
case $(uname) in
|
|
|
|
CYGWIN*)
|
2009-07-25 16:44:53 +02:00
|
|
|
if [ -z "$PREFIX" ]; then
|
|
|
|
DEST=
|
|
|
|
INIT=
|
|
|
|
fi
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
OWNER=$(id -un)
|
|
|
|
GROUP=$(id -gn)
|
|
|
|
CYGWIN=Yes
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
[ -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)
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "Shorewall6 Firewall Installer Version $VERSION"
|
2008-12-09 17:50:17 +01:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
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=""
|
|
|
|
fi
|
|
|
|
fi
|
2009-07-25 16:30:08 +02:00
|
|
|
|
|
|
|
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
|
|
|
|
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
|
|
|
|
|
|
|
|
CYGWIN=
|
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; }
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ -z "$CYGWIN" ]; then
|
|
|
|
if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
|
|
|
|
DEBIAN=yes
|
|
|
|
elif [ -f /etc/slackware-version ] ; then
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
# Check for /etc/shorewall6
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -d ${PREFIX}/etc/shorewall6 ]; then
|
2008-12-09 17:50:17 +01:00
|
|
|
first_install=""
|
|
|
|
else
|
|
|
|
first_install="Yes"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$CYGWIN" ]; then
|
2009-02-22 22:06:51 +01:00
|
|
|
install_file shorewall6 ${PREFIX}/sbin/shorewall6 0755 ${PREFIX}/var/lib/shorewall6-${VERSION}.bkout
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "shorewall6 control program installed in ${PREFIX}/sbin/shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
2009-02-22 22:06:51 +01:00
|
|
|
install_file shorewall6 ${PREFIX}/bin/shorewall6 0755 ${PREFIX}/var/lib/shorewall6-${VERSION}.bkout
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "shorewall6 control program installed in ${PREFIX}/bin/shorewall6"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
2009-02-22 22:06:51 +01:00
|
|
|
install_file init.debian.sh /etc/init.d/shorewall6 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout
|
2009-02-22 18:19:19 +01:00
|
|
|
elif [ -n "$SLACKWARE" ]; then
|
2009-02-22 22:06:51 +01:00
|
|
|
install_file init.slackware.shorewall6.sh ${PREFIX}${DEST}/rc.shorewall6 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout
|
2008-12-09 17:50:17 +01:00
|
|
|
elif [ -n "$ARCHLINUX" ]; then
|
2009-02-22 22:06:51 +01:00
|
|
|
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout
|
2008-12-09 17:50:17 +01:00
|
|
|
elif [ -n "$INIT" ]; then
|
2009-02-22 22:06:51 +01:00
|
|
|
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall6-${VERSION}.bkout
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
[ -n "$CYGWIN" ] || echo "Shorewall6 script installed in ${PREFIX}${DEST}/$INIT"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Create /etc/shorewall, /usr/share/shorewall and /var/shorewall if needed
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
mkdir -p ${PREFIX}/etc/shorewall6
|
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall6
|
|
|
|
mkdir -p ${PREFIX}/usr/share/shorewall6/configfiles
|
|
|
|
mkdir -p ${PREFIX}/var/lib/shorewall6
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
chmod 755 ${PREFIX}/etc/shorewall6
|
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall6
|
|
|
|
chmod 755 ${PREFIX}/usr/share/shorewall6/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-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 shorewall6.conf ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
qt mywhich perl && perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall6/configfiles:/usr/share/shorewall6|;' ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ ! -f ${PREFIX}/etc/shorewall6/shorewall6.conf ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 shorewall6.conf ${PREFIX}/etc/shorewall6/shorewall6.conf
|
|
|
|
echo "Config file installed as ${PREFIX}/etc/shorewall6/shorewall6.conf"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$ARCHLINUX" ] ; then
|
2008-12-09 21:15:57 +01:00
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall6/shorewall6.conf
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 zones ${PREFIX}/usr/share/shorewall6/configfiles/zones
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/zones ]; then
|
|
|
|
run_install $OWNERSHIP -m 0744 zones ${PREFIX}/etc/shorewall6/zones
|
|
|
|
echo "Zones file installed as ${PREFIX}/etc/shorewall6/zones"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/compiler
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.accounting
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.actions
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.dynamiczones
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.maclist
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.nat
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.providers
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.proxyarp
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.tc
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.tcrules
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/lib.tunnels
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/prog.header
|
|
|
|
delete_file ${PREFIX}/usr/share/shorewall6/prog.footer
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install wait4ifup
|
|
|
|
#
|
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
install_file wait4ifup ${PREFIX}/usr/share/shorewall6/wait4ifup 0755
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
echo
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "wait4ifup installed in ${PREFIX}/usr/share/shorewall6/wait4ifup"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 policy ${PREFIX}/usr/share/shorewall6/configfiles/policy
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/policy ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 policy ${PREFIX}/etc/shorewall6/policy
|
|
|
|
echo "Policy file installed as ${PREFIX}/etc/shorewall6/policy"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 interfaces ${PREFIX}/usr/share/shorewall6/configfiles/interfaces
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/interfaces ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 interfaces ${PREFIX}/etc/shorewall6/interfaces
|
|
|
|
echo "Interfaces file installed as ${PREFIX}/etc/shorewall6/interfaces"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the hosts file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 hosts ${PREFIX}/usr/share/shorewall6/configfiles/hosts
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/hosts ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 hosts ${PREFIX}/etc/shorewall6/hosts
|
|
|
|
echo "Hosts file installed as ${PREFIX}/etc/shorewall6/hosts"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 rules ${PREFIX}/usr/share/shorewall6/configfiles/rules
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/rules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 rules ${PREFIX}/etc/shorewall6/rules
|
|
|
|
echo "Rules file installed as ${PREFIX}/etc/shorewall6/rules"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${PREFIX}/usr/share/shorewall6/configfiles/params
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -f ${PREFIX}/etc/shorewall6/params ]; then
|
|
|
|
chmod 0644 ${PREFIX}/etc/shorewall6/params
|
2008-12-09 17:50:17 +01:00
|
|
|
else
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${PREFIX}/etc/shorewall6/params
|
|
|
|
echo "Parameter file installed as ${PREFIX}/etc/shorewall6/params"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Stopped Routing file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 routestopped ${PREFIX}/usr/share/shorewall6/configfiles/routestopped
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/routestopped ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 routestopped ${PREFIX}/etc/shorewall6/routestopped
|
|
|
|
echo "Stopped Routing file installed as ${PREFIX}/etc/shorewall6/routestopped"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 maclist ${PREFIX}/usr/share/shorewall6/configfiles/maclist
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/maclist ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 maclist ${PREFIX}/etc/shorewall6/maclist
|
|
|
|
echo "MAC list file installed as ${PREFIX}/etc/shorewall6/maclist"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Modules file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 modules ${PREFIX}/usr/share/shorewall6/modules
|
|
|
|
echo "Modules file installed as ${PREFIX}/usr/share/shorewall6/modules"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TC Rules file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcrules ${PREFIX}/usr/share/shorewall6/configfiles/tcrules
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/tcrules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcrules ${PREFIX}/etc/shorewall6/tcrules
|
|
|
|
echo "TC Rules file installed as ${PREFIX}/etc/shorewall6/tcrules"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tos ${PREFIX}/usr/share/shorewall6/configfiles/tos
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/tos ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tos ${PREFIX}/etc/shorewall6/tos
|
|
|
|
echo "TOS file installed as ${PREFIX}/etc/shorewall6/tos"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tunnels ${PREFIX}/usr/share/shorewall6/configfiles/tunnels
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/tunnels ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tunnels ${PREFIX}/etc/shorewall6/tunnels
|
|
|
|
echo "Tunnels file installed as ${PREFIX}/etc/shorewall6/tunnels"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the blacklist file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 blacklist ${PREFIX}/usr/share/shorewall6/configfiles/blacklist
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/blacklist ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 blacklist ${PREFIX}/etc/shorewall6/blacklist
|
|
|
|
echo "Blacklist file installed as ${PREFIX}/etc/shorewall6/blacklist"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 providers ${PREFIX}/usr/share/shorewall6/configfiles/providers
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/providers ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 providers ${PREFIX}/etc/shorewall6/providers
|
|
|
|
echo "Providers file installed as ${PREFIX}/etc/shorewall6/providers"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 route_rules ${PREFIX}/usr/share/shorewall6/configfiles/route_rules
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/route_rules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 route_rules ${PREFIX}/etc/shorewall6/route_rules
|
|
|
|
echo "Routing rules file installed as ${PREFIX}/etc/shorewall6/route_rules"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses ${PREFIX}/usr/share/shorewall6/configfiles/tcclasses
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/tcclasses ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcclasses ${PREFIX}/etc/shorewall6/tcclasses
|
|
|
|
echo "TC Classes file installed as ${PREFIX}/etc/shorewall6/tcclasses"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices ${PREFIX}/usr/share/shorewall6/configfiles/tcdevices
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/tcdevices ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcdevices ${PREFIX}/etc/shorewall6/tcdevices
|
|
|
|
echo "TC Devices file installed as ${PREFIX}/etc/shorewall6/tcdevices"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
2009-02-21 18:21:51 +01:00
|
|
|
#
|
|
|
|
# Install the Notrack file
|
|
|
|
#
|
2009-02-22 21:18:07 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 notrack ${PREFIX}/usr/share/shorewall6/configfiles/notrack
|
2009-02-21 18:21:51 +01:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/notrack ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 notrack ${PREFIX}/etc/shorewall6/notrack
|
|
|
|
echo "Notrack file installed as ${PREFIX}/etc/shorewall6/notrack"
|
|
|
|
fi
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
install_file configpath ${PREFIX}/usr/share/shorewall6/configpath 0644
|
|
|
|
echo "Default config path file installed as ${PREFIX}/usr/share/shorewall6/configpath"
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Install the init file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 init ${PREFIX}/usr/share/shorewall6/configfiles/init
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/init ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 init ${PREFIX}/etc/shorewall6/init
|
|
|
|
echo "Init file installed as ${PREFIX}/etc/shorewall6/init"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the start file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 start ${PREFIX}/usr/share/shorewall6/configfiles/start
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/start ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 start ${PREFIX}/etc/shorewall6/start
|
|
|
|
echo "Start file installed as ${PREFIX}/etc/shorewall6/start"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 stop ${PREFIX}/usr/share/shorewall6/configfiles/stop
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/stop ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stop ${PREFIX}/etc/shorewall6/stop
|
|
|
|
echo "Stop file installed as ${PREFIX}/etc/shorewall6/stop"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 stopped ${PREFIX}/usr/share/shorewall6/configfiles/stopped
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/stopped ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stopped ${PREFIX}/etc/shorewall6/stopped
|
|
|
|
echo "Stopped file installed as ${PREFIX}/etc/shorewall6/stopped"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 accounting ${PREFIX}/usr/share/shorewall6/configfiles/accounting
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/accounting ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 accounting ${PREFIX}/etc/shorewall6/accounting
|
|
|
|
echo "Accounting file installed as ${PREFIX}/etc/shorewall6/accounting"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Started file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 started ${PREFIX}/usr/share/shorewall6/configfiles/started
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/started ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 started ${PREFIX}/etc/shorewall6/started
|
|
|
|
echo "Started file installed as ${PREFIX}/etc/shorewall6/started"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-05 21:38:50 +01:00
|
|
|
# Install the Restored file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 restored ${PREFIX}/usr/share/shorewall6/configfiles/restored
|
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/restored ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 restored ${PREFIX}/etc/shorewall6/restored
|
|
|
|
echo "Restored file installed as ${PREFIX}/etc/shorewall6/restored"
|
|
|
|
fi
|
|
|
|
#
|
2009-05-20 22:40:42 +02:00
|
|
|
# Install the Clear file
|
|
|
|
#
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 clear ${PREFIX}/usr/share/shorewall6/configfiles/clear
|
2009-05-20 22:40:42 +02:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/clear ]; then
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 clear ${PREFIX}/etc/shorewall6/clear
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Clear file installed as ${PREFIX}/etc/shorewall6/clear"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Isusable file
|
|
|
|
#
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 isusable ${PREFIX}/usr/share/shorewall6/configfiles/isusable
|
2009-05-20 22:40:42 +02:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/isusable ]; then
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 isusable ${PREFIX}/etc/shorewall6/isusable
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Isusable file installed as ${PREFIX}/etc/shorewall/isusable"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refresh file
|
|
|
|
#
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 refresh ${PREFIX}/usr/share/shorewall6/configfiles/refresh
|
2009-05-20 22:40:42 +02:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/refresh ]; then
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 refresh ${PREFIX}/etc/shorewall6/refresh
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Refresh file installed as ${PREFIX}/etc/shorewall6/refresh"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refreshed file
|
|
|
|
#
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 refreshed ${PREFIX}/usr/share/shorewall6/configfiles/refreshed
|
2009-05-20 22:40:42 +02:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/refreshed ]; then
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 refreshed ${PREFIX}/etc/shorewall6/refreshed
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Refreshed file installed as ${PREFIX}/etc/shorewall6/refreshed"
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tcclear file
|
|
|
|
#
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclear ${PREFIX}/usr/share/shorewall6/configfiles/tcclear
|
2009-05-20 22:40:42 +02:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/tcclear ]; then
|
2009-05-22 17:52:31 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 tcclear ${PREFIX}/etc/shorewall6/tcclear
|
2009-05-20 22:40:42 +02:00
|
|
|
echo "Tcclear file installed as ${PREFIX}/etc/shorewall6/tcclear"
|
|
|
|
fi
|
|
|
|
#
|
2008-12-09 17:50:17 +01:00
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
install_file actions.std ${PREFIX}/usr/share/shorewall6/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${PREFIX}/usr/shared/shorewall6/actions.std"
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Actions file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 actions ${PREFIX}/usr/share/shorewall6/configfiles/actions
|
2008-12-09 17:50:17 +01:00
|
|
|
|
2008-12-09 21:15:57 +01:00
|
|
|
if [ -z "$CYGWIN" -a ! -f ${PREFIX}/etc/shorewall6/actions ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 actions ${PREFIX}/etc/shorewall6/actions
|
|
|
|
echo "Actions file installed as ${PREFIX}/etc/shorewall6/actions"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Makefiles
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 Makefile-lite ${PREFIX}/usr/share/shorewall6/configfiles/Makefile
|
2008-12-09 17:50:17 +01:00
|
|
|
|
|
|
|
if [ -z "$CYGWIN" ]; then
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall6/Makefile
|
|
|
|
echo "Makefile installed as ${PREFIX}/etc/shorewall6/Makefile"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Action files
|
|
|
|
#
|
|
|
|
for f in action.* ; do
|
2008-12-09 21:15:57 +01:00
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall6/$f 0644
|
|
|
|
echo "Action ${f#*.} file installed as ${PREFIX}/usr/share/shorewall6/$f"
|
2008-12-09 17:50:17 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
# Install the Macro files
|
|
|
|
#
|
|
|
|
for f in macro.* ; do
|
2008-12-09 21:15:57 +01:00
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall6/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${PREFIX}/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
|
2008-12-09 21:15:57 +01:00
|
|
|
install_file $f ${PREFIX}/usr/share/shorewall6/$f 0644
|
|
|
|
echo "Library ${f#*.} file installed as ${PREFIX}/usr/share/shorewall6/$f"
|
2008-12-09 17:50:17 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
#
|
|
|
|
# Symbolically link 'functions' to lib.base
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
ln -sf lib.base ${PREFIX}/usr/share/shorewall6/functions
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Create the version file
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "$VERSION" > ${PREFIX}/usr/share/shorewall6/version
|
|
|
|
chmod 644 ${PREFIX}/usr/share/shorewall6/version
|
2008-12-09 17:50:17 +01:00
|
|
|
#
|
|
|
|
# Remove and create the symbolic link to the init script
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ -z "$PREFIX" ]; 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
|
|
|
|
2008-12-14 19:08:56 +01:00
|
|
|
for f in *.5; do
|
|
|
|
gzip -c $f > $f.gz
|
2009-02-22 18:19:19 +01:00
|
|
|
run_install -D -m 0644 $f.gz ${PREFIX}${MANDIR}/man5/$f.gz
|
|
|
|
echo "Man page $f.gz installed to ${PREFIX}${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
|
2009-02-22 21:46:05 +01:00
|
|
|
run_install -D -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-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
|
|
|
|
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/shorewall6
|
|
|
|
echo "Logrotate file installed as ${PREFIX}/etc/logrotate.d/shorewall6"
|
|
|
|
fi
|
|
|
|
|
2008-12-09 17:50:17 +01:00
|
|
|
if [ -z "$PREFIX" -a -n "$first_install" -a -z "$CYGWIN" ]; then
|
|
|
|
if [ -n "$DEBIAN" ]; then
|
2008-12-09 21:15:57 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall6
|
|
|
|
ln -s ../init.d/shorewall6 /etc/rcS.d/S40shorewall6
|
|
|
|
echo "shorewall6 will start automatically at boot"
|
|
|
|
echo "Set startup=1 in /etc/default/shorewall6 to enable"
|
|
|
|
touch /var/log/shorewall6-init.log
|
|
|
|
qt mywhich perl && perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' /etc/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
|
|
|
|
#
|
2008-12-09 21:15:57 +01:00
|
|
|
echo "shorewall6-common Version $VERSION Installed"
|