2008-12-07 19:17:26 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Script to install Shoreline Firewall
|
|
|
|
#
|
2014-01-04 18:48:27 +01:00
|
|
|
# (c) 2000-201,2014 - Tom Eastep (teastep@shorewall.net)
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Shorewall documentation is available at http://shorewall.net
|
|
|
|
#
|
2014-01-04 18:48:27 +01:00
|
|
|
# This program is part of Shorewall.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by the
|
|
|
|
# Free Software Foundation, either version 2 of the license or, at your
|
|
|
|
# option, any later version.
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2014-01-04 18:48:27 +01:00
|
|
|
# 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.
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2014-01-04 18:48:27 +01:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
|
2012-06-09 18:34:28 +02:00
|
|
|
VERSION=4.5.5 #The Build script inserts the actual version
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Change to the directory containing this script
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
usage() # $1 = exit status
|
|
|
|
{
|
|
|
|
ME=$(basename $0)
|
2012-03-25 16:49:52 +02:00
|
|
|
echo "usage: $ME [ <configuration-file> ]"
|
2008-12-07 19:17:26 +01:00
|
|
|
echo " $ME -v"
|
|
|
|
echo " $ME -h"
|
2011-05-30 17:15:59 +02:00
|
|
|
echo " $ME -s"
|
2012-01-04 01:35:41 +01:00
|
|
|
echo " $ME -a"
|
2008-12-07 19:17:26 +01:00
|
|
|
exit $1
|
|
|
|
}
|
|
|
|
|
2012-04-24 23:52:57 +02:00
|
|
|
fatal_error()
|
2012-03-24 21:05:39 +01:00
|
|
|
{
|
|
|
|
echo " ERROR: $@" >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
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
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
return 2
|
|
|
|
}
|
|
|
|
|
|
|
|
run_install()
|
|
|
|
{
|
|
|
|
if ! install $*; then
|
|
|
|
echo
|
|
|
|
echo "ERROR: Failed to install $*" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
cant_autostart()
|
|
|
|
{
|
|
|
|
echo
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "WARNING: Unable to configure $PRODUCT to start automatically at boot" >&2
|
2008-12-07 19:17:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
delete_file() # $1 = file to delete
|
|
|
|
{
|
|
|
|
rm -f $1
|
|
|
|
}
|
|
|
|
|
|
|
|
install_file() # $1 = source $2 = target $3 = mode
|
|
|
|
{
|
2010-05-29 19:50:39 +02:00
|
|
|
run_install $T $OWNERSHIP -m $3 $1 ${2}
|
2008-12-07 19:17:26 +01:00
|
|
|
}
|
|
|
|
|
2012-04-24 23:52:57 +02:00
|
|
|
require()
|
2012-03-24 21:05:39 +01:00
|
|
|
{
|
|
|
|
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
|
|
|
|
}
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd "$(dirname $0)"
|
|
|
|
|
|
|
|
if [ -f shorewall ]; then
|
|
|
|
PRODUCT=shorewall
|
|
|
|
Product=Shorewall
|
|
|
|
else
|
|
|
|
PRODUCT=shorewall6
|
|
|
|
Product=Shorewall6
|
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Parse the run line
|
|
|
|
#
|
|
|
|
#
|
2010-05-29 19:50:39 +02:00
|
|
|
T="-T"
|
2012-01-04 01:35:41 +01:00
|
|
|
INSTALLD='-D'
|
2012-02-21 21:34:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
finished=0
|
2011-04-03 18:56:30 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
while [ $finished -eq 0 ]; do
|
|
|
|
option=$1
|
2011-05-14 14:31:19 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
case "$option" in
|
|
|
|
-*)
|
|
|
|
option=${option#-}
|
|
|
|
|
|
|
|
while [ -n "$option" ]; do
|
|
|
|
case $option in
|
|
|
|
h)
|
|
|
|
usage 0
|
|
|
|
;;
|
|
|
|
v)
|
|
|
|
echo "$Product Firewall Installer Version $VERSION"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
s*)
|
|
|
|
SPARSE=Yes
|
|
|
|
option=${option#s}
|
|
|
|
;;
|
|
|
|
a*)
|
|
|
|
ANNOTATED=Yes
|
|
|
|
option=${option#a}
|
|
|
|
;;
|
|
|
|
p*)
|
|
|
|
ANNOTATED=
|
|
|
|
option=${option#p}
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
finished=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Read the RC file
|
|
|
|
#
|
2014-08-07 15:36:23 +02:00
|
|
|
if [ $# -eq 0 ]; then
|
2012-04-01 02:40:18 +02:00
|
|
|
if [ -f ./shorewallrc ]; then
|
|
|
|
. ./shorewallrc
|
|
|
|
elif [ -f ~/.shorewallrc ]; then
|
|
|
|
. ~/.shorewallrc || exit 1
|
2014-08-07 15:36:23 +02:00
|
|
|
file=./.shorewallrc
|
2012-03-30 21:02:25 +02:00
|
|
|
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
|
|
|
. /usr/share/shorewall/shorewallrc
|
2012-03-24 21:05:39 +01:00
|
|
|
else
|
2012-03-30 21:02:25 +02:00
|
|
|
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
2012-03-24 21:05:39 +01:00
|
|
|
fi
|
|
|
|
elif [ $# -eq 1 ]; then
|
|
|
|
file=$1
|
|
|
|
case $file in
|
|
|
|
/*|.*)
|
|
|
|
;;
|
|
|
|
*)
|
2014-08-07 15:36:23 +02:00
|
|
|
file=./$file
|
2012-03-24 21:05:39 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
. $file
|
|
|
|
else
|
|
|
|
usage 1
|
|
|
|
fi
|
|
|
|
|
2012-09-02 23:36:11 +02:00
|
|
|
if [ -z "${VARLIB}" ]; then
|
|
|
|
VARLIB=${VARDIR}
|
2012-09-10 20:12:43 +02:00
|
|
|
VARDIR=${VARLIB}/${PRODUCT}
|
2012-09-03 00:51:35 +02:00
|
|
|
elif [ -z "${VARDIR}" ]; then
|
2012-09-10 20:12:43 +02:00
|
|
|
VARDIR=${VARLIB}/${PRODUCT}
|
2012-09-02 23:36:11 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
for var in SHAREDIR LIBEXECDIR PERLLIBDIR CONFDIR SBINDIR VARLIB VARDIR; do
|
2012-03-24 21:05:39 +01:00
|
|
|
require $var
|
|
|
|
done
|
|
|
|
|
|
|
|
[ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
|
2011-05-14 14:31:19 +02:00
|
|
|
|
2012-02-22 22:32:10 +01:00
|
|
|
if [ -z "$BUILD" ]; then
|
2012-02-17 22:22:06 +01:00
|
|
|
case $(uname) in
|
2014-08-07 15:40:34 +02:00
|
|
|
cygwin*|CYGWIN*)
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=cygwin
|
2012-02-17 22:22:06 +01:00
|
|
|
;;
|
|
|
|
Darwin)
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=apple
|
2012-02-17 22:22:06 +01:00
|
|
|
;;
|
|
|
|
*)
|
2013-08-09 02:44:40 +02:00
|
|
|
if [ -f /etc/os-release ]; then
|
|
|
|
eval $(cat /etc/os-release | grep ^ID)
|
|
|
|
|
|
|
|
case $ID in
|
2014-05-20 00:15:52 +02:00
|
|
|
fedora|rhel)
|
2013-08-09 02:44:40 +02:00
|
|
|
BUILD=redhat
|
|
|
|
;;
|
|
|
|
debian)
|
|
|
|
BUILD=debian
|
|
|
|
;;
|
2013-09-17 17:22:52 +02:00
|
|
|
gentoo)
|
|
|
|
BUILD=gentoo
|
|
|
|
;;
|
2013-08-09 02:44:40 +02:00
|
|
|
opensuse)
|
|
|
|
BUILD=suse
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
BUILD="$ID"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
elif [ -f /etc/debian_version ]; then
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=debian
|
2013-09-17 17:22:52 +02:00
|
|
|
elif [ -f /etc/gentoo-release ]; then
|
|
|
|
BUILD=gentoo
|
2012-02-17 22:22:06 +01:00
|
|
|
elif [ -f /etc/redhat-release ]; then
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=redhat
|
2012-02-17 22:22:06 +01:00
|
|
|
elif [ -f /etc/slackware-version ] ; then
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=slackware
|
2012-02-18 00:26:02 +01:00
|
|
|
elif [ -f /etc/SuSE-release ]; then
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=suse
|
2012-02-17 22:22:06 +01:00
|
|
|
elif [ -f /etc/arch-release ] ; then
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=archlinux
|
2012-02-17 22:22:06 +01:00
|
|
|
else
|
2012-02-22 22:32:10 +01:00
|
|
|
BUILD=linux
|
2012-02-17 22:22:06 +01:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2012-02-22 22:32:10 +01:00
|
|
|
case $BUILD in
|
|
|
|
cygwin*)
|
2008-12-07 19:17:26 +01:00
|
|
|
OWNER=$(id -un)
|
|
|
|
GROUP=$(id -gn)
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
apple)
|
2010-05-06 17:17:17 +02:00
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=wheel
|
2010-05-29 19:57:27 +02:00
|
|
|
INSTALLD=
|
2010-05-29 19:50:39 +02:00
|
|
|
T=
|
2010-06-07 18:16:56 +02:00
|
|
|
;;
|
2008-12-07 19:17:26 +01:00
|
|
|
*)
|
|
|
|
[ -z "$OWNER" ] && OWNER=root
|
|
|
|
[ -z "$GROUP" ] && GROUP=root
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
OWNERSHIP="-o $OWNER -g $GROUP"
|
|
|
|
|
2012-02-22 22:32:10 +01:00
|
|
|
case "$HOST" in
|
|
|
|
cygwin)
|
2012-02-17 22:22:06 +01:00
|
|
|
echo "Installing Cygwin-specific configuration..."
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
apple)
|
2012-02-17 22:22:06 +01:00
|
|
|
echo "Installing Mac-specific configuration...";
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
debian)
|
2012-02-17 22:22:06 +01:00
|
|
|
echo "Installing Debian-specific configuration..."
|
|
|
|
;;
|
2013-09-17 17:22:52 +02:00
|
|
|
gentoo)
|
|
|
|
echo "Installing Gentoo-specific configuration..."
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
redhat)
|
2012-02-17 22:22:06 +01:00
|
|
|
echo "Installing Redhat/Fedora-specific configuration..."
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
suse)
|
2012-02-21 23:24:50 +01:00
|
|
|
echo "Installing SuSE-specific configuration...";
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
slackware)
|
2012-02-17 22:22:06 +01:00
|
|
|
echo "Installing Slackware-specific configuration..."
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
archlinux)
|
2012-02-17 22:22:06 +01:00
|
|
|
echo "Installing ArchLinux-specific configuration..."
|
|
|
|
;;
|
2012-02-22 22:32:10 +01:00
|
|
|
linux)
|
2012-02-17 22:22:06 +01:00
|
|
|
;;
|
|
|
|
*)
|
2012-02-22 22:32:10 +01:00
|
|
|
echo "ERROR: Unknown HOST \"$HOST\"" >&2
|
2012-02-17 22:22:06 +01:00
|
|
|
exit 1;
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-06-09 18:34:28 +02:00
|
|
|
if [ $PRODUCT = shorewall ]; then
|
|
|
|
if [ -n "$DIGEST" ]; then
|
|
|
|
#
|
|
|
|
# The user specified which digest to use
|
|
|
|
#
|
|
|
|
if [ "$DIGEST" != SHA ]; then
|
|
|
|
if [ "$BUILD" = "$HOST" ] && ! eval perl -e \'use Digest::$DIGEST\;\' 2> /dev/null ; then
|
|
|
|
echo "ERROR: Perl compilation with Digest::$DIGEST failed" >&2
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Chains.pm
|
|
|
|
fi
|
|
|
|
elif [ "$BUILD" = "$HOST" ]; then
|
|
|
|
#
|
|
|
|
# Fix up 'use Digest::' if SHA1 is installed
|
|
|
|
#
|
|
|
|
DIGEST=SHA
|
|
|
|
if ! perl -e 'use Digest::SHA;' 2> /dev/null ; then
|
|
|
|
if perl -e 'use Digest::SHA1;' 2> /dev/null ; then
|
|
|
|
sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Chains.pm
|
|
|
|
DIGEST=SHA1
|
|
|
|
else
|
|
|
|
echo "ERROR: Shorewall $VERSION requires either Digest::SHA or Digest::SHA1" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$BUILD" = "$HOST" ]; then
|
|
|
|
#
|
|
|
|
# Verify that Perl and all required modules are installed
|
|
|
|
#
|
|
|
|
echo "Compiling the Shorewall Perl Modules with Digest::$DIGEST"
|
|
|
|
|
|
|
|
if ! perl -c Perl/compiler.pl; then
|
|
|
|
echo "ERROR: $Product $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
|
|
|
|
else
|
|
|
|
echo "Using Digest::$DIGEST"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ $BUILD != cygwin ]; then
|
|
|
|
if [ `id -u` != 0 ] ; then
|
|
|
|
echo "Not setting file owner/group permissions, not running as root."
|
|
|
|
OWNERSHIP=""
|
|
|
|
fi
|
2012-02-20 19:08:42 +01:00
|
|
|
fi
|
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
install -d $OWNERSHIP -m 755 ${DESTDIR}${SBINDIR}
|
|
|
|
[ -n "${INITFILE}" ] && install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
|
|
|
|
if [ -z "$DESTDIR" -a $PRODUCT != shorewall ]; then
|
|
|
|
[ -x ${LIBEXECDIR}/shorewall/compiler.pl ] || \
|
2012-02-26 01:02:20 +01:00
|
|
|
{ echo " ERROR: Shorewall >= 4.5.0 is not installed" >&2; exit 1; }
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "Installing $Product Version $VERSION"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
# Check for /sbin/$PRODUCT
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -f ${DESTDIR}${SBINDIR}/$PRODUCT ]; then
|
2008-12-07 19:17:26 +01:00
|
|
|
first_install=""
|
|
|
|
else
|
|
|
|
first_install="Yes"
|
|
|
|
fi
|
|
|
|
|
2014-08-07 15:36:23 +02:00
|
|
|
if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f ${SHAREDIR}/$PRODUCT/coreversion ]; then
|
|
|
|
echo "Shorewall $VERSION requires Shorewall Core which does not appear to be installed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0755
|
2012-04-01 19:47:24 +02:00
|
|
|
[ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SBINDIR}/${PRODUCT}
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "$PRODUCT control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Firewall Script
|
|
|
|
#
|
2012-02-23 19:59:10 +01:00
|
|
|
if [ -n "$INITFILE" ]; then
|
2012-04-27 16:16:11 +02:00
|
|
|
if [ -f "${INITSOURCE}" ]; then
|
2013-08-15 15:51:27 +02:00
|
|
|
initfile="${DESTDIR}/${INITDIR}/${INITFILE}"
|
|
|
|
install_file $INITSOURCE "$initfile" 0544
|
|
|
|
|
|
|
|
[ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' "$initfile"
|
|
|
|
|
2013-09-09 17:11:45 +02:00
|
|
|
echo "SysV init script $INITSOURCE installed in $initfile"
|
2012-03-24 21:05:39 +01:00
|
|
|
fi
|
2012-02-23 19:59:10 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
# Create /etc/$PRODUCT and other directories
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2014-08-07 15:36:23 +02:00
|
|
|
mkdir -p ${DESTDIR}${CONFDIR}/$PRODUCT
|
|
|
|
mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT
|
2012-03-24 21:05:39 +01:00
|
|
|
mkdir -p ${DESTDIR}${PERLLIBDIR}/Shorewall
|
|
|
|
mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-09-02 23:36:11 +02:00
|
|
|
mkdir -p ${DESTDIR}${VARDIR}
|
2009-11-03 19:06:10 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
chmod 755 ${DESTDIR}${CONFDIR}/$PRODUCT
|
|
|
|
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT
|
|
|
|
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2011-06-18 22:03:55 +02:00
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -n "$DESTDIR" ]; then
|
2012-03-24 21:05:39 +01:00
|
|
|
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
|
|
|
|
chmod 755 ${DESTDIR}${CONFDIR}/logrotate.d
|
2009-11-03 19:06:10 +01:00
|
|
|
fi
|
2010-06-07 18:16:56 +02:00
|
|
|
|
2011-08-23 23:07:44 +02:00
|
|
|
#
|
|
|
|
# Install the .service file
|
|
|
|
#
|
|
|
|
if [ -n "$SYSTEMD" ]; then
|
2012-03-30 22:56:59 +02:00
|
|
|
mkdir -p ${DESTDIR}${SYSTEMD}
|
2013-08-18 23:27:26 +02:00
|
|
|
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
|
2014-05-01 20:43:00 +02:00
|
|
|
run_install $OWNERSHIP -m 644 $SERVICEFILE ${DESTDIR}${SYSTEMD}/$PRODUCT.service
|
2012-09-24 23:32:20 +02:00
|
|
|
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SYSTEMD}/$PRODUCT.service
|
2013-08-18 23:27:26 +02:00
|
|
|
echo "Service file $SERVICEFILE installed as ${DESTDIR}${SYSTEMD}/$PRODUCT.service"
|
2011-08-23 23:07:44 +02:00
|
|
|
fi
|
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
#
|
|
|
|
# These use absolute path names since the files that they are removing existed
|
|
|
|
# prior to the use of directory variables
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/compiler
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.accounting
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.actions
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.dynamiczones
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.maclist
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.nat
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.providers
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.proxyarp
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.tc
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.tcrules
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/lib.tunnels
|
2012-01-04 19:32:17 +01:00
|
|
|
|
|
|
|
if [ $PRODUCT = shorewall6 ]; then
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.cli
|
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/lib.common
|
2012-01-06 20:40:04 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/shorewall6/wait4ifup
|
2012-01-04 19:32:17 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.header6
|
|
|
|
delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.footer6
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Modules file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 modules ${DESTDIR}${SHAREDIR}/$PRODUCT/modules
|
|
|
|
echo "Modules file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/modules"
|
2012-01-04 01:35:41 +01:00
|
|
|
|
|
|
|
for f in modules.*; do
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f
|
|
|
|
echo "Modules file $f installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
2012-01-04 01:35:41 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Module Helpers file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 helpers ${DESTDIR}${SHAREDIR}/$PRODUCT/helpers
|
|
|
|
echo "Helper modules file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/helpers"
|
2012-01-04 01:35:41 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the default config path file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file configpath ${DESTDIR}${SHAREDIR}/$PRODUCT/configpath 0644
|
|
|
|
echo "Default config path file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/configpath"
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Install the Standard Actions file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file actions.std ${DESTDIR}${SHAREDIR}/$PRODUCT/actions.std 0644
|
|
|
|
echo "Standard actions file installed as ${DESTDIR}${SHAREDIR}d/$PRODUCT/actions.std"
|
2012-01-04 01:35:41 +01:00
|
|
|
|
|
|
|
cd configfiles
|
|
|
|
|
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
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the config file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 $PRODUCT.conf ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 $PRODUCT.conf.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
|
|
|
|
if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 ${PRODUCT}.conf${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
2012-04-24 23:52:57 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ "$SHAREDIR" != /usr/share -o "$CONFDIR" != /etc ]; then
|
|
|
|
if [ $PRODUCT = shorewall ]; then
|
|
|
|
perl -p -w -i -e "s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
|
|
|
else
|
|
|
|
perl -p -w -i -e "s|^CONFIG_PATH=.*|CONFIG_PATH=${CONFDIR}/shorewall:${SHAREDIR}/shorewall6:${SHAREDIR}/shorewall|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
|
|
|
fi
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ $HOST = archlinux ] ; then
|
|
|
|
sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
|
|
|
elif [ $HOST = debian ]; then
|
|
|
|
perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
|
2013-09-17 17:22:52 +02:00
|
|
|
elif [ $HOST = gentoo ]; then
|
|
|
|
# Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316)
|
|
|
|
perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/$PRODUCT|;" ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf${suffix}
|
2012-03-24 21:05:39 +01:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "Config file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/$PRODUCT.conf"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
# Install the init file
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 init ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/init
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/init ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 init ${DESTDIR}${CONFDIR}/$PRODUCT/init
|
|
|
|
echo "Init file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/init"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Install the zones file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 zones ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 zones.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/zones ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 zones${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/zones
|
|
|
|
echo "Zones file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/zones"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the policy file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 policy ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 policy.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/policy ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 policy${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/policy
|
|
|
|
echo "Policy file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/policy"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the interfaces file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 interfaces ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 interfaces.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/interfaces ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 interfaces${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/interfaces
|
|
|
|
echo "Interfaces file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/interfaces"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the hosts file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 hosts ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 hosts.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/hosts ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 hosts${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/hosts
|
|
|
|
echo "Hosts file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/hosts"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the rules file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 rules ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 rules.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/rules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 rules${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/rules
|
|
|
|
echo "Rules file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/rules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f nat ]; then
|
|
|
|
#
|
|
|
|
# Install the NAT file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 nat ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 nat.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/nat ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 nat${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/nat
|
|
|
|
echo "NAT file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/nat"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the NETMAP file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 netmap ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 netmap.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/netmap ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 netmap${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/netmap
|
|
|
|
echo "NETMAP file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/netmap"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Parameters file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 params ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 params.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -f ${DESTDIR}${CONFDIR}/$PRODUCT/params ]; then
|
|
|
|
chmod 0644 ${DESTDIR}${CONFDIR}/$PRODUCT/params
|
2008-12-07 19:17:26 +01:00
|
|
|
else
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 params${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/params
|
|
|
|
echo "Parameter file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/params"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ $PRODUCT = shorewall ]; then
|
|
|
|
#
|
|
|
|
# Install the proxy ARP file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 proxyarp ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyarp.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/proxyarp ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 proxyarp${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/proxyarp
|
|
|
|
echo "Proxy ARP file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/proxyarp"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
#
|
|
|
|
# Install the Proxyndp file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 proxyndp ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 proxyndp.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/proxyndp ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 proxyndp${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/proxyndp
|
|
|
|
echo "Proxyndp file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/proxyndp"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2012-09-03 20:00:22 +02:00
|
|
|
# Install the Stopped Rules file
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-09-03 20:00:22 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 stoppedrules ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 stoppedrules.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-09-03 20:00:22 +02:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/stoppedrules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stoppedrules${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/stoppedrules
|
|
|
|
echo "Stopped Rules file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/stoppedrules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Mac List file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 maclist ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 maclist.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/maclist ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 maclist${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/maclist
|
|
|
|
echo "mac list file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/maclist"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f masq ]; then
|
|
|
|
#
|
|
|
|
# Install the Masq file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 masq ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 masq.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/masq ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 masq${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/masq
|
|
|
|
echo "Masquerade file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/masq"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
2013-01-04 18:17:57 +01:00
|
|
|
|
|
|
|
if [ -f arprules ]; then
|
|
|
|
#
|
|
|
|
# Install the ARP rules file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 arprules ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 arprules.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/arprules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 arprules${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/arprules
|
|
|
|
echo "ARP rules file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/arprules"
|
|
|
|
fi
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2012-08-02 20:02:17 +02:00
|
|
|
# Install the Conntrack file
|
2009-02-21 18:21:51 +01:00
|
|
|
#
|
2012-08-02 20:02:17 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 conntrack ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 conntrack.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2009-02-21 18:21:51 +01:00
|
|
|
|
2012-08-16 19:50:23 +02:00
|
|
|
if [ ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/conntrack ]; then
|
2012-08-02 20:02:17 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 conntrack${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/conntrack
|
|
|
|
echo "Conntrack file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/conntrack"
|
2009-02-21 18:21:51 +01:00
|
|
|
fi
|
2010-01-21 18:53:28 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2013-12-29 00:24:05 +01:00
|
|
|
# Install the Mangle file
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
2013-12-29 00:24:05 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 mangle ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 mangle.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2013-12-29 00:24:05 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/mangle ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 mangle${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/mangle
|
|
|
|
echo "Mangle file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/mangle"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-01-18 16:39:36 +01:00
|
|
|
#
|
|
|
|
# Install the TC Interfaces file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcinterfaces ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcinterfaces.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tcinterfaces ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcinterfaces${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tcinterfaces
|
|
|
|
echo "TC Interfaces file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tcinterfaces"
|
2010-01-18 16:39:36 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the TC Priority file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcpri ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcpri.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2010-01-18 16:39:36 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tcpri ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcpri${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tcpri
|
|
|
|
echo "TC Priority file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tcpri"
|
2010-01-18 16:39:36 +01:00
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the TOS file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tos ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tos.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tos ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tos${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tos
|
|
|
|
echo "TOS file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tos"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tunnels file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tunnels ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tunnels.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tunnels ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tunnels${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tunnels
|
|
|
|
echo "Tunnels file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tunnels"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
2011-11-06 21:05:07 +01:00
|
|
|
# Install the blacklist rules file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 blrules ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 blrules.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2011-11-06 21:05:07 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/blrules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 blrules${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/blrules
|
|
|
|
echo "Blrules file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/blrules"
|
2011-11-06 21:05:07 +01:00
|
|
|
fi
|
2009-09-14 22:43:32 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f findgw ]; then
|
|
|
|
#
|
|
|
|
# Install the findgw file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 findgw ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/findgw ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 findgw ${DESTDIR}${CONFDIR}/$PRODUCT
|
|
|
|
echo "Find GW file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/findgw"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2009-09-14 22:43:32 +02:00
|
|
|
fi
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Delete the Limits Files
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/action.Limit
|
|
|
|
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/Limit
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Delete the xmodules file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/xmodules
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the Providers file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 providers ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 providers.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/providers ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 providers${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/providers
|
|
|
|
echo "Providers file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/providers"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Route Rules file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 rtrules ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 rtrules.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2012-01-09 15:38:55 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -f ${DESTDIR}${CONFDIR}/$PRODUCT/route_rules -a ! ${DESTDIR}${CONFDIR}/$PRODUCT/rtrules ]; then
|
|
|
|
mv -f ${DESTDIR}${CONFDIR}/$PRODUCT/route_rules ${DESTDIR}${CONFDIR}/$PRODUCT/rtrules
|
|
|
|
echo "${DESTDIR}${CONFDIR}/$PRODUCT/route_rules has been renamed ${DESTDIR}${CONFDIR}/$PRODUCT/rtrules"
|
|
|
|
elif [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/rtrules ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 rtrules${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/rtrules
|
|
|
|
echo "Routing rules file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/rtrules"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcclasses file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcclasses.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tcclasses ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcclasses${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tcclasses
|
|
|
|
echo "TC Classes file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tcclasses"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcdevices file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcdevices.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tcdevices ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcdevices${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tcdevices
|
|
|
|
echo "TC Devices file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tcdevices"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the tcfilters file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcfilters ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 tcfilters.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tcfilters ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcfilters${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/tcfilters
|
|
|
|
echo "TC Filters file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tcfilters"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2010-09-07 16:56:11 +02:00
|
|
|
#
|
|
|
|
# Install the secmarks file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 secmarks ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 secmarks.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2010-09-07 16:56:11 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/secmarks ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 secmarks${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/secmarks
|
|
|
|
echo "Secmarks file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/secmarks"
|
2010-09-07 16:56:11 +02:00
|
|
|
fi
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the init file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 init ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/init ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 init ${DESTDIR}${CONFDIR}/$PRODUCT
|
|
|
|
echo "Init file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/init"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f initdone ]; then
|
|
|
|
#
|
|
|
|
# Install the initdone file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 initdone ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/initdone ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 initdone ${DESTDIR}${CONFDIR}/$PRODUCT
|
|
|
|
echo "Initdone file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/initdone"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the start file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 start ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/start
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/start ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 start ${DESTDIR}${CONFDIR}/$PRODUCT/start
|
|
|
|
echo "Start file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/start"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stop file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 stop ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/stop
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/stop ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stop ${DESTDIR}${CONFDIR}/$PRODUCT/stop
|
|
|
|
echo "Stop file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/stop"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the stopped file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 stopped ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/stopped
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/stopped ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 stopped ${DESTDIR}${CONFDIR}/$PRODUCT/stopped
|
|
|
|
echo "Stopped file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/stopped"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -f ecn ]; then
|
|
|
|
#
|
|
|
|
# Install the ECN file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 ecn ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
|
|
|
run_install $OWNERSHIP -m 0644 ecn.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/ecn ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 ecn${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/ecn
|
|
|
|
echo "ECN file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/ecn"
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Accounting file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 accounting ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 accounting.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/accounting ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 accounting${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/accounting
|
|
|
|
echo "Accounting file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/accounting"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-06-20 18:35:08 +02:00
|
|
|
# Install the private library file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 lib.private ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles
|
2009-06-20 18:35:08 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/lib.private ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 lib.private ${DESTDIR}${CONFDIR}/$PRODUCT
|
|
|
|
echo "Private library file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/lib.private"
|
2009-06-20 18:35:08 +02:00
|
|
|
fi
|
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Install the Started file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 started ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/started
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/started ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 started ${DESTDIR}${CONFDIR}/$PRODUCT/started
|
|
|
|
echo "Started file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/started"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-02-05 21:38:50 +01:00
|
|
|
# Install the Restored file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 restored ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/restored
|
2009-02-05 21:38:50 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/restored ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 restored ${DESTDIR}${CONFDIR}/$PRODUCT/restored
|
|
|
|
echo "Restored file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/restored"
|
2009-02-05 21:38:50 +01:00
|
|
|
fi
|
|
|
|
#
|
2009-05-20 02:11:31 +02:00
|
|
|
# Install the Clear file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 clear ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/clear
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/clear ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 clear ${DESTDIR}${CONFDIR}/$PRODUCT/clear
|
|
|
|
echo "Clear file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/clear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
2012-03-12 21:57:37 +01:00
|
|
|
# Install the Isusable file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/isusable
|
2012-03-12 21:57:37 +01:00
|
|
|
#
|
2009-05-20 02:11:31 +02:00
|
|
|
# Install the Refresh file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 refresh ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/refresh
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/refresh ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 refresh ${DESTDIR}${CONFDIR}/$PRODUCT/refresh
|
|
|
|
echo "Refresh file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/refresh"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Refreshed file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 refreshed ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/refreshed
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/refreshed ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 refreshed ${DESTDIR}${CONFDIR}/$PRODUCT/refreshed
|
|
|
|
echo "Refreshed file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/refreshed"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Tcclear file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 tcclear ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2009-05-20 02:11:31 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/tcclear ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 tcclear ${DESTDIR}${CONFDIR}/$PRODUCT/tcclear
|
|
|
|
echo "Tcclear file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/tcclear"
|
2009-05-20 02:11:31 +02:00
|
|
|
fi
|
|
|
|
#
|
2010-10-01 18:15:58 +02:00
|
|
|
# Install the Scfilter file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 scfilter ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/scfilter
|
2010-10-01 18:15:58 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/scfilter ]; then
|
|
|
|
run_install $OWNERSHIP -m 0600 scfilter ${DESTDIR}${CONFDIR}/$PRODUCT/scfilter
|
|
|
|
echo "Scfilter file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/scfilter"
|
2010-10-01 18:15:58 +02:00
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Actions file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 actions ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 actions.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/actions ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 actions${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/actions
|
|
|
|
echo "Actions file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/actions"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
2013-03-14 22:03:05 +01:00
|
|
|
#
|
|
|
|
# Install the Routes file
|
|
|
|
#
|
|
|
|
run_install $OWNERSHIP -m 0644 routes ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
run_install $OWNERSHIP -m 0644 routes.annotated ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
|
|
|
|
|
|
|
|
if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/$PRODUCT/routes ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 routes${suffix} ${DESTDIR}${CONFDIR}/$PRODUCT/routes
|
|
|
|
echo "Routes file installed as ${DESTDIR}${CONFDIR}/$PRODUCT/routes"
|
|
|
|
fi
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd ..
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the Makefiles
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
run_install $OWNERSHIP -m 0644 Makefile-lite ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/Makefile
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2010-02-27 20:48:39 +01:00
|
|
|
if [ -z "$SPARSE" ]; then
|
2012-04-14 20:17:27 +02:00
|
|
|
run_install $OWNERSHIP -m 0600 Makefile ${DESTDIR}${CONFDIR}/$PRODUCT
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "Makefile installed as ${DESTDIR}${CONFDIR}/$PRODUCT/Makefile"
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
#
|
|
|
|
# Install the Action files
|
|
|
|
#
|
|
|
|
for f in action.* ; do
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
|
|
|
echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
|
|
|
|
2009-03-04 01:46:31 +01:00
|
|
|
cd Macros
|
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
for f in macro.* ; do
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
|
|
|
echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
2009-03-04 01:46:31 +01:00
|
|
|
|
|
|
|
cd ..
|
2012-01-04 01:35:41 +01:00
|
|
|
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Install the libraries
|
|
|
|
#
|
2012-06-02 21:46:35 +02:00
|
|
|
for f in lib.* Perl/lib.*; do
|
2012-03-31 21:57:38 +02:00
|
|
|
if [ -f $f ]; then
|
2012-06-02 21:46:35 +02:00
|
|
|
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$(basename $f) 0644
|
2012-03-31 21:57:38 +02:00
|
|
|
echo "Library ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
|
|
|
fi
|
2008-12-07 19:17:26 +01:00
|
|
|
done
|
2009-03-04 23:45:07 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ $PRODUCT = shorewall6 ]; then
|
|
|
|
#
|
|
|
|
# Symbolically link 'functions' to lib.base
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
ln -sf lib.base ${DESTDIR}${SHAREDIR}/$PRODUCT/functions
|
2012-04-01 19:47:24 +02:00
|
|
|
[ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}/${SHAREDIR}/${PRODUCT}/lib.base
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
2009-02-22 19:28:18 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
if [ -d Perl ]; then
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
# ${SHAREDIR}/$PRODUCT/$Product if needed
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT/$Product
|
|
|
|
chmod 755 ${DESTDIR}${SHAREDIR}/$PRODUCT/$Product
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Install the Compiler
|
|
|
|
#
|
|
|
|
cd Perl
|
2010-11-07 01:04:17 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file compiler.pl ${DESTDIR}${LIBEXECDIR}/$PRODUCT/compiler.pl 0755
|
2009-03-04 23:45:07 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "Compiler installed in ${DESTDIR}${LIBEXECDIR}/$PRODUCT/compiler.pl"
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Install the params file helper
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file getparams ${DESTDIR}${LIBEXECDIR}/$PRODUCT/getparams 0755
|
2012-04-07 18:07:07 +02:00
|
|
|
[ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${LIBEXECDIR}/$PRODUCT/getparams
|
2012-01-04 01:35:41 +01:00
|
|
|
|
|
|
|
echo
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "Params file helper installed in ${DESTDIR}${LIBEXECDIR}/$PRODUCT/getparams"
|
2012-01-04 01:35:41 +01:00
|
|
|
#
|
|
|
|
# Install the Perl modules
|
|
|
|
#
|
|
|
|
for f in $Product/*.pm ; do
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file $f ${DESTDIR}${PERLLIBDIR}/$f 0644
|
|
|
|
echo "Module ${f%.*} installed as ${DESTDIR}${PERLLIBDIR}/$f"
|
2012-01-04 01:35:41 +01:00
|
|
|
done
|
|
|
|
#
|
|
|
|
# Install the program skeleton files
|
|
|
|
#
|
|
|
|
for f in prog.* ; do
|
2012-03-24 21:05:39 +01:00
|
|
|
install_file $f ${DESTDIR}${SHAREDIR}/$PRODUCT/$f 0644
|
|
|
|
echo "Program skeleton file ${f#*.} installed as ${DESTDIR}${SHAREDIR}/$PRODUCT/$f"
|
2012-01-04 01:35:41 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
if [ -z "$DESTDIR" ]; then
|
2012-03-24 21:05:39 +01:00
|
|
|
rm -rf ${SHAREDIR}/$PRODUCT-perl
|
|
|
|
rm -rf ${SHAREDIR}/$PRODUCT-shell
|
|
|
|
[ "$PERLLIBDIR" != ${SHAREDIR}/$PRODUCT ] && rm -rf ${SHAREDIR}/$PRODUCT/$Product
|
2012-01-04 01:35:41 +01:00
|
|
|
fi
|
|
|
|
fi
|
2009-02-22 19:28:18 +01:00
|
|
|
#
|
2008-12-07 19:17:26 +01:00
|
|
|
# Create the version file
|
|
|
|
#
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "$VERSION" > ${DESTDIR}${SHAREDIR}/$PRODUCT/version
|
|
|
|
chmod 644 ${DESTDIR}${SHAREDIR}/$PRODUCT/version
|
2008-12-07 19:17:26 +01:00
|
|
|
#
|
|
|
|
# Remove and create the symbolic link to the init script
|
|
|
|
#
|
|
|
|
|
2010-06-01 15:42:11 +02:00
|
|
|
if [ -z "$DESTDIR" ]; then
|
2012-03-24 21:05:39 +01:00
|
|
|
rm -f ${SHAREDIR}/$PRODUCT/init
|
|
|
|
ln -s ${INITDIR}/${INITFILE} ${SHAREDIR}/$PRODUCT/init
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install the Man Pages
|
|
|
|
#
|
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd manpages
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
|
2010-05-09 01:32:03 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
for f in *.5; do
|
2012-04-22 02:51:06 +02:00
|
|
|
gzip -9c $f > $f.gz
|
2012-01-04 01:35:41 +01: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"
|
|
|
|
done
|
2010-05-24 01:02:28 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
for f in *.8; do
|
2012-04-22 02:51:06 +02:00
|
|
|
gzip -9c $f > $f.gz
|
2012-01-04 01:35:41 +01: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"
|
|
|
|
done
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
cd ..
|
2010-05-24 01:02:28 +02:00
|
|
|
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "Man Pages Installed"
|
2008-12-07 19:17:26 +01:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
|
|
|
|
run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT
|
|
|
|
echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT"
|
2009-10-01 16:37:30 +02:00
|
|
|
fi
|
|
|
|
|
2013-09-10 17:24:27 +02:00
|
|
|
#
|
|
|
|
# Note -- not all packages will have the SYSCONFFILE so we need to check for its existance here
|
|
|
|
#
|
|
|
|
if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ ${DESTDIR} ]; then
|
|
|
|
mkdir -p ${DESTDIR}${SYSCONFDIR}
|
|
|
|
chmod 755 ${DESTDIR}${SYSCONFDIR}
|
|
|
|
fi
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2013-08-18 17:30:11 +02:00
|
|
|
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
|
|
|
|
fi
|
2010-06-25 20:14:55 +02:00
|
|
|
|
2012-03-24 21:05:39 +01:00
|
|
|
if [ -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
|
2013-09-29 18:28:22 +02:00
|
|
|
if [ -n "$SYSTEMD" ]; then
|
2012-07-14 23:38:30 +02:00
|
|
|
if systemctl enable ${PRODUCT}.service; then
|
2012-03-24 21:05:39 +01:00
|
|
|
echo "$Product will start automatically at boot"
|
|
|
|
fi
|
|
|
|
elif mywhich insserv; then
|
|
|
|
if insserv ${CONFDIR}/init.d/$PRODUCT ; then
|
|
|
|
echo "$PRODUCT will start automatically at boot"
|
2013-09-29 18:28:22 +02:00
|
|
|
if [ $HOST = debian ]; then
|
|
|
|
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
|
|
|
touch /var/log/$PRODUCT-init.log
|
|
|
|
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
|
|
|
else
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable"
|
|
|
|
fi
|
2012-03-24 21:05:39 +01:00
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
|
|
|
elif mywhich chkconfig; then
|
|
|
|
if chkconfig --add $PRODUCT ; then
|
|
|
|
echo "$PRODUCT will start automatically in run levels as follows:"
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable"
|
|
|
|
chkconfig --list $PRODUCT
|
|
|
|
else
|
|
|
|
cant_autostart
|
|
|
|
fi
|
2013-10-25 15:53:51 +02:00
|
|
|
elif mywhich update-rc.d ; then
|
|
|
|
echo "$PRODUCT will start automatically at boot"
|
|
|
|
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
|
|
|
touch /var/log/$PRODUCT-init.log
|
|
|
|
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
|
|
|
update-rc.d $PRODUCT enable
|
2012-03-24 21:05:39 +01:00
|
|
|
elif mywhich rc-update ; then
|
|
|
|
if rc-update add $PRODUCT default; then
|
|
|
|
echo "$PRODUCT will start automatically at boot"
|
2013-09-29 18:28:22 +02:00
|
|
|
if [ $HOST = debian ]; then
|
|
|
|
echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable"
|
|
|
|
touch /var/log/$PRODUCT-init.log
|
|
|
|
perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf
|
|
|
|
else
|
|
|
|
echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable"
|
|
|
|
fi
|
2012-03-24 21:05:39 +01:00
|
|
|
else
|
2008-12-07 19:17:26 +01:00
|
|
|
cant_autostart
|
|
|
|
fi
|
2012-03-24 21:05:39 +01:00
|
|
|
elif [ "$INITFILE" != rc.f ]; then #Slackware starts this automatically
|
|
|
|
cant_autostart
|
2008-12-07 19:17:26 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Report Success
|
|
|
|
#
|
2012-01-04 01:35:41 +01:00
|
|
|
echo "$Product Version $VERSION Installed"
|