"Fossies" - the Fresh Open Source Software Archive

Member "shorewall6-5.2.3.4/install.sh" (27 Aug 2019, 43678 Bytes) of package /linux/misc/shorewall/shorewall6-5.2.3.4.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "install.sh": 5.2.3.3_vs_5.2.3.4.

    1 #!/bin/sh
    2 #
    3 # Script to install Shoreline Firewall
    4 #
    5 #     (c) 2000-2018 - Tom Eastep (teastep@shorewall.net)
    6 #
    7 #       Shorewall documentation is available at http://shorewall.net
    8 #
    9 #       This program is part of Shorewall.
   10 #
   11 #   This program is free software; you can redistribute it and/or modify
   12 #   it under the terms of the GNU General Public License as published by the
   13 #       Free Software Foundation, either version 2 of the license or, at your
   14 #       option, any later version.
   15 #
   16 #   This program is distributed in the hope that it will be useful,
   17 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
   18 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   19 #   GNU General Public License for more details.
   20 #
   21 #   You should have received a copy of the GNU General Public License
   22 #   along with this program; if not, see <http://www.gnu.org/licenses/>.
   23 #
   24 
   25 VERSION=5.2.3.4
   26 
   27 usage() # $1 = exit status
   28 {
   29     ME=$(basename $0)
   30     echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
   31     echo "where <option> is one of"
   32     echo "  -h"
   33     echo "  -v"
   34     echo "  -s"
   35     echo "  -a"
   36     echo "  -p"
   37     echo "  -n"
   38     exit $1
   39 }
   40 
   41 run_install()
   42 {
   43     if ! install $*; then
   44     echo
   45     echo "ERROR: Failed to install $*" >&2
   46     exit 1
   47     fi
   48 }
   49 
   50 install_file() # $1 = source $2 = target $3 = mode
   51 {
   52     run_install $T $OWNERSHIP -m $3 $1 ${2}
   53 }
   54 
   55 #
   56 # Change to the directory containing this script
   57 #
   58 cd "$(dirname $0)"
   59 
   60 if [ -f shorewall.service ]; then
   61     PRODUCT=shorewall
   62     Product=Shorewall
   63 else
   64     PRODUCT=shorewall6
   65     Product=Shorewall6
   66 fi
   67 
   68 #
   69 # Source common functions
   70 #
   71 . ./lib.installer || { echo "ERROR: Can not load common functions." >&2; exit 1; }
   72 
   73 #
   74 # Parse the run line
   75 #
   76 #
   77 T="-T"
   78 INSTALLD='-D'
   79 
   80 finished=0
   81 configure=1
   82 
   83 while [ $finished -eq 0 ]; do
   84     option=$1
   85 
   86     case "$option" in
   87     -*)
   88         option=${option#-}
   89 
   90         while [ -n "$option" ]; do
   91         case $option in
   92             h)
   93             usage 0
   94             ;;
   95             v)
   96             echo "$Product Firewall Installer Version $VERSION"
   97             exit 0
   98             ;;
   99             s*)
  100             SPARSE=Yes
  101             option=${option#s}
  102             ;;
  103             a*)
  104             ANNOTATED=Yes
  105             option=${option#a}
  106             ;;
  107             p*)
  108             ANNOTATED=
  109             option=${option#p}
  110             ;;
  111             n*)
  112             configure=0
  113             option=${option#n}
  114             ;;
  115             *)
  116             usage 1
  117             ;;
  118         esac
  119         done
  120 
  121         shift
  122         ;;
  123     *)
  124         finished=1
  125         ;;
  126     esac
  127 done
  128 
  129 #
  130 # Read the RC file
  131 #
  132 if [ $# -eq 0 ]; then
  133     if [ -f ./shorewallrc ]; then
  134     file=./shorewallrc
  135         . $file || fatal_error "Can not load the RC file: $file"
  136     elif [ -f ~/.shorewallrc ]; then
  137     file=~/.shorewallrc
  138         . $file || fatal_error "Can not load the RC file: $file"
  139     elif [ -f /usr/share/shorewall/shorewallrc ]; then
  140     file=/usr/share/shorewall/shorewallrc
  141         . $file || fatal_error "Can not load the RC file: $file"
  142     else
  143     fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
  144     fi
  145 elif [ $# -eq 1 ]; then
  146     file=$1
  147     case $file in
  148     /*|.*)
  149         ;;
  150     *)
  151         file=./$file || exit 1
  152         ;;
  153     esac
  154 
  155     . $file || fatal_error "Can not load the RC file: $file"
  156 else
  157     usage 1
  158 fi
  159 
  160 if [ -z "${VARLIB}" ]; then
  161     VARLIB=${VARDIR}
  162     VARDIR=${VARLIB}/${PRODUCT}
  163 elif [ -z "${VARDIR}" ]; then
  164     VARDIR=${VARLIB}/${PRODUCT}
  165 fi
  166 
  167 for var in SHAREDIR LIBEXECDIR PERLLIBDIR CONFDIR SBINDIR VARLIB VARDIR; do
  168     require $var
  169 done
  170 
  171 [ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
  172 
  173 [ -n "$SANDBOX" ] && configure=0
  174 
  175 if [ -z "$BUILD" ]; then
  176     case $(uname) in
  177     cygwin*|CYGWIN*)
  178         BUILD=cygwin
  179         ;;
  180     Darwin)
  181         BUILD=apple
  182         ;;
  183     *)
  184         if [ -f /etc/os-release ]; then
  185         eval $(cat /etc/os-release | grep ^ID)
  186 
  187         case $ID in
  188             fedora|rhel|centos|foobar)
  189             BUILD=redhat
  190             ;;
  191             debian)
  192             BUILD=debian
  193             ;;
  194             gentoo)
  195             BUILD=gentoo
  196             ;;
  197             opensuse)
  198             BUILD=suse
  199             ;;
  200             alt|basealt|altlinux)
  201             BUILD=alt
  202             ;;
  203             *)
  204             BUILD="$ID"
  205             ;;
  206         esac
  207         elif [ -f /etc/debian_version ]; then
  208         BUILD=debian
  209         elif [ -f /etc/gentoo-release ]; then
  210         BUILD=gentoo
  211         elif [ -f /etc/altlinux-release ]; then
  212         BUILD=alt
  213         elif [ -f /etc/redhat-release ]; then
  214         BUILD=redhat
  215         elif [ -f /etc/slackware-version ] ; then
  216         BUILD=slackware
  217         elif [ -f /etc/SuSE-release ]; then
  218         BUILD=suse
  219         elif [ -f /etc/arch-release ] ; then
  220         BUILD=archlinux
  221         elif [ -f ${CONFDIR}/openwrt_release ] ; then
  222         BUILD=openwrt
  223         else
  224         BUILD=linux
  225         fi
  226         ;;
  227     esac
  228 fi
  229 
  230 case $BUILD in
  231     cygwin*)
  232     OWNER=$(id -un)
  233     GROUP=$(id -gn)
  234     ;;
  235     apple)
  236     [ -z "$OWNER" ] && OWNER=root
  237     [ -z "$GROUP" ] && GROUP=wheel
  238     INSTALLD=
  239     T=
  240     ;;
  241     *)
  242     [ -z "$OWNER" ] && OWNER=root
  243     [ -z "$GROUP" ] && GROUP=root
  244     ;;
  245 esac
  246 
  247 OWNERSHIP="-o $OWNER -g $GROUP"
  248 
  249 case "$HOST" in
  250     cygwin)
  251     echo "Installing Cygwin-specific configuration..."
  252     ;;
  253     apple)
  254     echo "Installing Mac-specific configuration...";
  255     ;;
  256     debian)
  257     echo "Installing Debian-specific configuration..."
  258     ;;
  259     gentoo)
  260     echo "Installing Gentoo-specific configuration..."
  261     ;;
  262     redhat)
  263     echo "Installing Redhat/Fedora-specific configuration..."
  264     ;;
  265     suse)
  266     echo "Installing SuSE-specific configuration...";
  267     ;;
  268     slackware)
  269     echo "Installing Slackware-specific configuration..."
  270     ;;
  271     archlinux)
  272     echo "Installing ArchLinux-specific configuration..."
  273     ;;
  274     openwrt)
  275     echo "Installing OpenWRT-specific configuration..."
  276     ;;
  277     alt)
  278     echo "Installing ALT-specific configuration...";
  279     ;;
  280     linux)
  281     ;;
  282     *)
  283     fatal_error "Unknown HOST \"$HOST\""
  284     ;;
  285 esac
  286 
  287 if [ ${PRODUCT} = shorewall ]; then
  288     if [ -n "$DIGEST" ]; then
  289     #
  290     # The user specified which digest to use
  291     #
  292     if [ "$DIGEST" != SHA ]; then
  293         if [ "$BUILD" = "$HOST" ] && ! eval perl -e \'use Digest::$DIGEST\;\' 2> /dev/null ; then
  294         fatal_error "Perl compilation with Digest::$DIGEST failed"
  295         fi
  296 
  297         cp -af Perl/Shorewall/Chains.pm Perl/Shorewall/Chains.pm.bak
  298         cp -af Perl/Shorewall/Config.pm Perl/Shorewall/Config.pm.bak
  299 
  300         eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Chains.pm
  301         eval sed -i \'s/Digest::SHA/Digest::$DIGEST/\' Perl/Shorewall/Config.pm
  302     fi
  303     elif [ "$BUILD" = "$HOST" ]; then
  304         #
  305         # Fix up 'use Digest::' if SHA1 is installed
  306         #
  307     DIGEST=SHA
  308     if ! perl -e 'use Digest::SHA;' 2> /dev/null ; then
  309         if perl -e 'use Digest::SHA1;' 2> /dev/null ; then
  310         cp -af Perl/Shorewall/Chains.pm Perl/Shorewall/Chains.pm.bak
  311         cp -af Perl/Shorewall/Config.pm Perl/Shorewall/Config.pm.bak
  312 
  313         sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Chains.pm
  314         sed -i 's/Digest::SHA/Digest::SHA1/' Perl/Shorewall/Config.pm
  315         DIGEST=SHA1
  316         else
  317         fatal_error "Shorewall $VERSION requires either Digest::SHA or Digest::SHA1"
  318         fi
  319     fi
  320     fi
  321 
  322     if [ "$BUILD" = "$HOST" ]; then
  323         #
  324         # Verify that Perl and all required modules are installed
  325         #
  326     echo "Compiling the Shorewall Perl Modules with Digest::$DIGEST"
  327 
  328     if ! perl -c Perl/compiler.pl; then
  329         echo "ERROR: $Product $VERSION requires Perl which either is not installed or is not able to compile the Shorewall Perl code" >&2
  330         echo "       Try perl -c $PWD/Perl/compiler.pl" >&2
  331         exit 1
  332     fi
  333     else
  334     echo "Using Digest::$DIGEST"
  335     fi
  336 fi
  337 
  338 if [ $BUILD != cygwin ]; then
  339     if [ `id -u` != 0 ] ; then
  340     echo "Not setting file owner/group permissions, not running as root."
  341     OWNERSHIP=""
  342     fi
  343 fi
  344 
  345 run_install -d $OWNERSHIP -m 0755 ${DESTDIR}${SBINDIR}
  346 [ -n "${INITFILE}" ] && run_install -d $OWNERSHIP -m 0755 ${DESTDIR}${INITDIR}
  347 if [ -z "$DESTDIR" -a ${PRODUCT} != shorewall ]; then
  348     [ -x ${LIBEXECDIR}/shorewall/compiler.pl ] || fatal_error "Shorewall >= 4.5.0 is not installed"
  349 fi
  350 
  351 echo "Installing $Product Version $VERSION"
  352 
  353 #
  354 # Check for /usr/share/${PRODUCT}/version
  355 #
  356 if [ -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/version ]; then
  357     first_install=""
  358 else
  359     first_install="Yes"
  360 fi
  361 
  362 if [ -z "${DESTDIR}" -a ${PRODUCT} = shorewall -a ! -f ${SHAREDIR}/shorewall/coreversion ]; then
  363     echo "Shorewall $VERSION requires Shorewall Core which does not appear to be installed"
  364     exit 1
  365 fi
  366 
  367 #
  368 # Install the Firewall Script
  369 #
  370 if [ -n "$INITFILE" ]; then
  371     if [ -f "${INITSOURCE}" ]; then
  372     initfile="${DESTDIR}${INITDIR}/${INITFILE}"
  373     install_file $INITSOURCE "$initfile" 0544
  374 
  375     [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' "$initfile"
  376 
  377     echo  "SysV init script $INITSOURCE installed in $initfile"
  378     fi
  379 fi
  380 
  381 #
  382 # Create /etc/${PRODUCT} and other directories
  383 #
  384 make_parent_directory ${DESTDIR}${CONFDIR}/${PRODUCT} 0755
  385 make_parent_directory ${DESTDIR}${LIBEXECDIR}/${PRODUCT} 0755
  386 make_parent_directory ${DESTDIR}${PERLLIBDIR}/Shorewall 0755
  387 make_parent_directory ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles 0755
  388 make_parent_directory ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated 0755
  389 make_parent_directory ${DESTDIR}${VARDIR} 0755
  390 
  391 chmod 0755 ${DESTDIR}${SHAREDIR}/${PRODUCT}
  392 
  393 [ -n "$DESTDIR" ] && make_parent_directory ${DESTDIR}${CONFDIR}/logrotate.d 0755
  394 
  395 #
  396 # Install the .service file
  397 #
  398 if [ -z "${SERVICEDIR}" ]; then
  399     SERVICEDIR="$SYSTEMD"
  400 fi
  401 
  402 if [ -n "$SERVICEDIR" ]; then
  403     make_parent_directory ${DESTDIR}${SERVICEDIR} 0755
  404     [ -z "$SERVICEFILE" ] && SERVICEFILE=${PRODUCT}.service
  405     run_install $OWNERSHIP -m 0644 $SERVICEFILE ${DESTDIR}${SERVICEDIR}/${PRODUCT}.service
  406     [ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\' ${DESTDIR}${SERVICEDIR}/${PRODUCT}.service
  407     echo "Service file $SERVICEFILE installed as ${DESTDIR}${SERVICEDIR}/${PRODUCT}.service"
  408 fi
  409 
  410 if [ -z "$first_install" ]; then
  411     #
  412     # These use absolute path names since the files that they are removing existed
  413     # prior to the use of directory variables
  414     #
  415     delete_file ${DESTDIR}/usr/share/${PRODUCT}/compiler
  416     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.accounting
  417     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.actions
  418     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.dynamiczones
  419     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.maclist
  420     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.nat
  421     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.providers
  422     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.proxyarp
  423     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.tc
  424     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.tcrules
  425     delete_file ${DESTDIR}/usr/share/${PRODUCT}/lib.tunnels
  426 
  427     if [ ${PRODUCT} = shorewall6 ]; then
  428     delete_file ${DESTDIR}/usr/share/shorewall6/lib.cli
  429     delete_file ${DESTDIR}/usr/share/shorewall6/lib.common
  430     delete_file ${DESTDIR}/usr/share/shorewall6/wait4ifup
  431     fi
  432 
  433     delete_file ${DESTDIR}/usr/share/${PRODUCT}/prog.header6
  434     delete_file ${DESTDIR}/usr/share/${PRODUCT}/prog.footer6
  435 
  436     #
  437     # Delete obsolete config files and manpages
  438     #
  439     delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/tos
  440     delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/tcrules
  441     delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/stoppedrules
  442     delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/notrack
  443     delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/blacklist
  444     delete_file ${DESTDIR}${MANDIR}/man5/${PRODUCT}/${PRODUCT}-tos
  445     delete_file ${DESTDIR}${MANDIR}/man5/${PRODUCT}/${PRODUCT}-tcrules
  446     delete_file ${DESTDIR}${MANDIR}/man5/${PRODUCT}/${PRODUCT}-stoppedrules
  447     delete_file ${DESTDIR}${MANDIR}/man5/${PRODUCT}/${PRODUCT}-notrack
  448     delete_file ${DESTDIR}${MANDIR}/man5/${PRODUCT}/${PRODUCT}-blacklist
  449 
  450     if [ ${PRODUCT} = shorewall ]; then
  451     #
  452     # Delete deprecated macros and actions
  453     #
  454     delete_file ${DESTDIR}${SHAREDIR}/shorewall/macro.SNMPTrap
  455     delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_REJECT
  456     delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.Drop
  457     delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.Reject
  458     delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_Drop
  459     delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_Reject
  460     delete_file ${DESTDIR}${SHAREDIR}/shorewall/action.A_AllowICMPs
  461     else
  462     delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.A_AllowICMPs
  463     delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.AllowICMPs
  464     delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.Broadcast
  465     delete_file ${DESTDIR}${SHAREDIR}/shorewall6/action.Multicast
  466     fi
  467 fi
  468 
  469 #
  470 # Install the Module Helpers file
  471 #
  472 run_install $OWNERSHIP -m 0644 helpers ${DESTDIR}${SHAREDIR}/${PRODUCT}/helpers
  473 echo "Helper modules file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/helpers"
  474 
  475 #
  476 # Install the default config path file
  477 #
  478 install_file configpath ${DESTDIR}${SHAREDIR}/${PRODUCT}/configpath 0644
  479 echo "Default config path file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/configpath"
  480 #
  481 # Install the Standard Actions file
  482 #
  483 install_file actions.std ${DESTDIR}${SHAREDIR}/${PRODUCT}/actions.std 0644
  484 echo "Standard actions file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/actions.std"
  485 
  486 cd configfiles
  487 
  488 if [ -n "$ANNOTATED" ]; then
  489     suffix=.annotated
  490 else
  491     suffix=
  492 fi
  493 
  494 #
  495 # Install the config file
  496 #
  497 fix_config() {
  498     if [ $HOST = archlinux ] ; then
  499     sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i $1
  500     elif [ $HOST = debian ]; then
  501     perl -p -w -i -e 's|^STARTUP_ENABLED=.*|STARTUP_ENABLED=Yes|;' $1
  502     elif [ $HOST = gentoo ]; then
  503     # Adjust SUBSYSLOCK path (see https://bugs.gentoo.org/show_bug.cgi?id=459316)
  504     perl -p -w -i -e "s|^SUBSYSLOCK=.*|SUBSYSLOCK=/run/lock/${PRODUCT}|;" $1
  505     fi
  506 }
  507 
  508 run_install $OWNERSHIP -m 0644 $PRODUCT.conf ${DESTDIR}${SHAREDIR}/$PRODUCT/configfiles/
  509 
  510 fix_config ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/${PRODUCT}.conf
  511 
  512 if [ ${PRODUCT} = shorewall ]; then
  513     run_install $OWNERSHIP -m 0644 shorewall.conf.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  514 
  515     fix_config ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/${PRODUCT}.conf.annotated
  516 fi
  517 
  518 if [ ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/${PRODUCT}.conf ]; then
  519     run_install $OWNERSHIP -m 0600 ${PRODUCT}.conf${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/${PRODUCT}.conf
  520 
  521     fix_config ${DESTDIR}${CONFDIR}/${PRODUCT}/${PRODUCT}.conf
  522 
  523     echo "Config file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/${PRODUCT}.conf"
  524 fi
  525 
  526 #
  527 # Install the init file
  528 #
  529 run_install $OWNERSHIP -m 0644 init ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/init
  530 
  531 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/init ]; then
  532     run_install $OWNERSHIP -m 0600 init ${DESTDIR}${CONFDIR}/${PRODUCT}/init
  533     echo "Init file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/init"
  534 fi
  535 
  536 #
  537 # Install the zones file
  538 #
  539 run_install $OWNERSHIP -m 0644 zones           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  540 run_install $OWNERSHIP -m 0644 zones.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  541 
  542 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/zones ]; then
  543     run_install $OWNERSHIP -m 0600 zones${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/zones
  544     echo "Zones file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/zones"
  545 fi
  546 
  547 #
  548 # Install the policy file
  549 #
  550 run_install $OWNERSHIP -m 0644 policy           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  551 run_install $OWNERSHIP -m 0644 policy.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  552 
  553 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/policy ]; then
  554     run_install $OWNERSHIP -m 0600 policy${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/policy
  555     echo "Policy file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/policy"
  556 fi
  557 #
  558 # Install the interfaces file
  559 #
  560 run_install $OWNERSHIP -m 0644 interfaces           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  561 run_install $OWNERSHIP -m 0644 interfaces.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  562 
  563 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/interfaces ]; then
  564     run_install $OWNERSHIP -m 0600 interfaces${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/interfaces
  565     echo "Interfaces file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/interfaces"
  566 fi
  567 
  568 #
  569 # Install the hosts file
  570 #
  571 run_install $OWNERSHIP -m 0644 hosts           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  572 run_install $OWNERSHIP -m 0644 hosts.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  573 
  574 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/hosts ]; then
  575     run_install $OWNERSHIP -m 0600 hosts${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/hosts
  576     echo "Hosts file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/hosts"
  577 fi
  578 #
  579 # Install the rules file
  580 #
  581 run_install $OWNERSHIP -m 0644 rules           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  582 run_install $OWNERSHIP -m 0644 rules.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  583 
  584 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/rules ]; then
  585     run_install $OWNERSHIP -m 0600 rules${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/rules
  586     echo "Rules file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/rules"
  587 fi
  588 
  589 if [ -f nat ]; then
  590     #
  591     # Install the NAT file
  592     #
  593     run_install $OWNERSHIP -m 0644 nat           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  594     run_install $OWNERSHIP -m 0644 nat.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  595 
  596     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/nat ]; then
  597     run_install $OWNERSHIP -m 0600 nat${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/nat
  598     echo "NAT file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/nat"
  599     fi
  600 fi
  601 
  602 #
  603 # Install the NETMAP file
  604 #
  605 run_install $OWNERSHIP -m 0644 netmap           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  606 run_install $OWNERSHIP -m 0644 netmap.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  607 
  608 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/netmap ]; then
  609     run_install $OWNERSHIP -m 0600 netmap${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/netmap
  610     echo "NETMAP file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/netmap"
  611 fi
  612 #
  613 # Install the Parameters file
  614 #
  615 run_install $OWNERSHIP -m 0644 params          ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  616 run_install $OWNERSHIP -m 0644 params.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  617 
  618 if [ -f ${DESTDIR}${CONFDIR}/${PRODUCT}/params ]; then
  619     chmod 0644 ${DESTDIR}${CONFDIR}/${PRODUCT}/params
  620 else
  621     case "$SPARSE" in
  622     [Vv]ery)
  623     ;;
  624     *)
  625         run_install $OWNERSHIP -m 0600 params${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/params
  626         echo "Parameter file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/params"
  627         ;;
  628     esac
  629 fi
  630 
  631 if [ ${PRODUCT} = shorewall ]; then
  632     #
  633     # Install the proxy ARP file
  634     #
  635     run_install $OWNERSHIP -m 0644 proxyarp           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  636     run_install $OWNERSHIP -m 0644 proxyarp.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  637 
  638     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/proxyarp ]; then
  639     run_install $OWNERSHIP -m 0600 proxyarp${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/proxyarp
  640     echo "Proxy ARP file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/proxyarp"
  641     fi
  642 else
  643     #
  644     # Install the Proxyndp file
  645     #
  646     run_install $OWNERSHIP -m 0644 proxyndp           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  647     run_install $OWNERSHIP -m 0644 proxyndp.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  648 
  649     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/proxyndp ]; then
  650     run_install $OWNERSHIP -m 0600 proxyndp${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/proxyndp
  651     echo "Proxyndp file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/proxyndp"
  652     fi
  653 fi
  654 #
  655 # Install the Stopped Rules file
  656 #
  657 run_install $OWNERSHIP -m 0644 stoppedrules           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  658 run_install $OWNERSHIP -m 0644 stoppedrules.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  659 
  660 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/stoppedrules ]; then
  661     run_install $OWNERSHIP -m 0600 stoppedrules${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/stoppedrules
  662     echo "Stopped Rules file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/stoppedrules"
  663 fi
  664 #
  665 # Install the Mac List file
  666 #
  667 run_install $OWNERSHIP -m 0644 maclist           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  668 run_install $OWNERSHIP -m 0644 maclist.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  669 
  670 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/maclist ]; then
  671     run_install $OWNERSHIP -m 0600 maclist${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/maclist
  672     echo "mac list file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/maclist"
  673 fi
  674 
  675 #
  676 # Install the SNAT file
  677 #
  678 run_install $OWNERSHIP -m 0644 snat           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  679 run_install $OWNERSHIP -m 0644 snat.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  680 
  681 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/snat ]; then
  682     run_install $OWNERSHIP -m 0600 snat${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/snat
  683     echo "SNAT file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/snat"
  684 fi
  685 
  686 if [ -f arprules ]; then
  687     #
  688     # Install the ARP rules file
  689     #
  690     run_install $OWNERSHIP -m 0644 arprules           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  691     run_install $OWNERSHIP -m 0644 arprules.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  692 
  693     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/arprules ]; then
  694     run_install $OWNERSHIP -m 0600 arprules${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/arprules
  695     echo "ARP rules file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/arprules"
  696     fi
  697 fi
  698 #
  699 # Install the Conntrack file
  700 #
  701 run_install $OWNERSHIP -m 0644 conntrack           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  702 run_install $OWNERSHIP -m 0644 conntrack.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  703 
  704 case "$SPARSE" in
  705     [Vv]ery)
  706     ;;
  707     *)
  708     if [ ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/conntrack ]; then
  709         run_install $OWNERSHIP -m 0600 conntrack${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/conntrack
  710         echo "Conntrack file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/conntrack"
  711     fi
  712     ;;
  713 esac
  714 
  715 #
  716 # Install the Mangle file
  717 #
  718 run_install $OWNERSHIP -m 0644 mangle           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  719 run_install $OWNERSHIP -m 0644 mangle.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  720 
  721 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/mangle ]; then
  722     run_install $OWNERSHIP -m 0600 mangle${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/mangle
  723     echo "Mangle file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/mangle"
  724 fi
  725 
  726 #
  727 # Install the TC Interfaces file
  728 #
  729 run_install $OWNERSHIP -m 0644 tcinterfaces           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  730 run_install $OWNERSHIP -m 0644 tcinterfaces.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  731 
  732 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tcinterfaces ]; then
  733     run_install $OWNERSHIP -m 0600 tcinterfaces${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/tcinterfaces
  734     echo "TC Interfaces file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tcinterfaces"
  735 fi
  736 
  737 #
  738 # Install the TC Priority file
  739 #
  740 run_install $OWNERSHIP -m 0644 tcpri           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  741 run_install $OWNERSHIP -m 0644 tcpri.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  742 
  743 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tcpri ]; then
  744     run_install $OWNERSHIP -m 0600 tcpri${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/tcpri
  745     echo "TC Priority file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tcpri"
  746 fi
  747 
  748 #
  749 # Install the Tunnels file
  750 #
  751 run_install $OWNERSHIP -m 0644 tunnels           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  752 run_install $OWNERSHIP -m 0644 tunnels.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  753 
  754 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tunnels ]; then
  755     run_install $OWNERSHIP -m 0600 tunnels${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/tunnels
  756     echo "Tunnels file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tunnels"
  757 fi
  758 
  759 #
  760 # Install the blacklist rules file
  761 #
  762 run_install $OWNERSHIP -m 0644 blrules           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  763 run_install $OWNERSHIP -m 0644 blrules.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  764 
  765 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/blrules ]; then
  766     run_install $OWNERSHIP -m 0600 blrules${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/blrules
  767     echo "Blrules file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/blrules"
  768 fi
  769 
  770 if [ -f findgw ]; then
  771     #
  772     # Install the findgw file
  773     #
  774     run_install $OWNERSHIP -m 0644 findgw ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  775 
  776     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/findgw ]; then
  777     run_install $OWNERSHIP -m 0600 findgw ${DESTDIR}${CONFDIR}/${PRODUCT}
  778     echo "Find GW file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/findgw"
  779     fi
  780 fi
  781 
  782 #
  783 # Delete the Limits Files
  784 #
  785 delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/action.Limit
  786 delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/Limit
  787 #
  788 # Delete the xmodules file
  789 #
  790 delete_file ${DESTDIR}${SHAREDIR}/${PRODUCT}/xmodules
  791 #
  792 # Install the Providers file
  793 #
  794 run_install $OWNERSHIP -m 0644 providers           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  795 run_install $OWNERSHIP -m 0644 providers.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  796 
  797 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/providers ]; then
  798     run_install $OWNERSHIP -m 0600 providers${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/providers
  799     echo "Providers file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/providers"
  800 fi
  801 
  802 #
  803 # Install the Route Rules file
  804 #
  805 run_install $OWNERSHIP -m 0644 rtrules           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  806 run_install $OWNERSHIP -m 0644 rtrules.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  807 
  808 if [ -f ${DESTDIR}${CONFDIR}/${PRODUCT}/route_rules -a ! ${DESTDIR}${CONFDIR}/${PRODUCT}/rtrules ]; then
  809     mv -f ${DESTDIR}${CONFDIR}/${PRODUCT}/route_rules ${DESTDIR}${CONFDIR}/${PRODUCT}/rtrules
  810     echo "${DESTDIR}${CONFDIR}/${PRODUCT}/route_rules has been renamed ${DESTDIR}${CONFDIR}/${PRODUCT}/rtrules"
  811 elif [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/rtrules ]; then
  812     run_install $OWNERSHIP -m 0600 rtrules${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/rtrules
  813     echo "Routing rules file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/rtrules"
  814 fi
  815 
  816 #
  817 # Install the tcclasses file
  818 #
  819 run_install $OWNERSHIP -m 0644 tcclasses           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  820 run_install $OWNERSHIP -m 0644 tcclasses.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  821 
  822 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tcclasses ]; then
  823     run_install $OWNERSHIP -m 0600 tcclasses${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/tcclasses
  824     echo "TC Classes file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tcclasses"
  825 fi
  826 
  827 #
  828 # Install the tcdevices file
  829 #
  830 run_install $OWNERSHIP -m 0644 tcdevices           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  831 run_install $OWNERSHIP -m 0644 tcdevices.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  832 
  833 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tcdevices ]; then
  834     run_install $OWNERSHIP -m 0600 tcdevices${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/tcdevices
  835     echo "TC Devices file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tcdevices"
  836 fi
  837 
  838 #
  839 # Install the tcfilters file
  840 #
  841 run_install $OWNERSHIP -m 0644 tcfilters           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  842 run_install $OWNERSHIP -m 0644 tcfilters.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  843 
  844 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tcfilters ]; then
  845     run_install $OWNERSHIP -m 0600 tcfilters${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/tcfilters
  846     echo "TC Filters file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tcfilters"
  847 fi
  848 
  849 #
  850 # Install the secmarks file
  851 #
  852 run_install $OWNERSHIP -m 0644 secmarks           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  853 run_install $OWNERSHIP -m 0644 secmarks.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  854 
  855 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/secmarks ]; then
  856     run_install $OWNERSHIP -m 0600 secmarks${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/secmarks
  857     echo "Secmarks file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/secmarks"
  858 fi
  859 
  860 #
  861 # Install the init file
  862 #
  863 run_install $OWNERSHIP -m 0644 init ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  864 
  865 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/init ]; then
  866     run_install $OWNERSHIP -m 0600 init ${DESTDIR}${CONFDIR}/${PRODUCT}
  867     echo "Init file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/init"
  868 fi
  869 
  870 if [ -f initdone ]; then
  871     #
  872     # Install the initdone file
  873     #
  874     run_install $OWNERSHIP -m 0644 initdone ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  875 
  876     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/initdone ]; then
  877     run_install $OWNERSHIP -m 0600 initdone ${DESTDIR}${CONFDIR}/${PRODUCT}
  878     echo "Initdone file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/initdone"
  879     fi
  880 fi
  881 #
  882 # Install the start file
  883 #
  884 run_install $OWNERSHIP -m 0644 start ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/start
  885 
  886 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/start ]; then
  887     run_install $OWNERSHIP -m 0600 start ${DESTDIR}${CONFDIR}/${PRODUCT}/start
  888     echo "Start file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/start"
  889 fi
  890 #
  891 # Install the stop file
  892 #
  893 run_install $OWNERSHIP -m 0644 stop ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/stop
  894 
  895 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/stop ]; then
  896     run_install $OWNERSHIP -m 0600 stop ${DESTDIR}${CONFDIR}/${PRODUCT}/stop
  897     echo "Stop file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/stop"
  898 fi
  899 #
  900 # Install the stopped file
  901 #
  902 run_install $OWNERSHIP -m 0644 stopped ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/stopped
  903 
  904 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/stopped ]; then
  905     run_install $OWNERSHIP -m 0600 stopped ${DESTDIR}${CONFDIR}/${PRODUCT}/stopped
  906     echo "Stopped file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/stopped"
  907 fi
  908 
  909 if [ -f ecn ]; then
  910     #
  911     # Install the ECN file
  912     #
  913     run_install $OWNERSHIP -m 0644 ecn           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  914     run_install $OWNERSHIP -m 0644 ecn.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  915 
  916     if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/ecn ]; then
  917     run_install $OWNERSHIP -m 0600 ecn${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/ecn
  918     echo "ECN file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/ecn"
  919     fi
  920 fi
  921 #
  922 # Install the Accounting file
  923 #
  924 run_install $OWNERSHIP -m 0644 accounting           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  925 run_install $OWNERSHIP -m 0644 accounting.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  926 
  927 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/accounting ]; then
  928     run_install $OWNERSHIP -m 0600 accounting${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/accounting
  929     echo "Accounting file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/accounting"
  930 fi
  931 #
  932 # Install the private library file
  933 #
  934 run_install $OWNERSHIP -m 0644 lib.private ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles
  935 
  936 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/lib.private ]; then
  937     run_install $OWNERSHIP -m 0600 lib.private ${DESTDIR}${CONFDIR}/${PRODUCT}
  938     echo "Private library file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/lib.private"
  939 fi
  940 #
  941 # Install the Started file
  942 #
  943 run_install $OWNERSHIP -m 0644 started ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/started
  944 
  945 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/started ]; then
  946     run_install $OWNERSHIP -m 0600 started ${DESTDIR}${CONFDIR}/${PRODUCT}/started
  947     echo "Started file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/started"
  948 fi
  949 #
  950 # Install the Restored file
  951 #
  952 run_install $OWNERSHIP -m 0644 restored ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/restored
  953 
  954 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/restored ]; then
  955     run_install $OWNERSHIP -m 0600 restored ${DESTDIR}${CONFDIR}/${PRODUCT}/restored
  956     echo "Restored file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/restored"
  957 fi
  958 #
  959 # Install the Clear file
  960 #
  961 run_install $OWNERSHIP -m 0644 clear ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/clear
  962 
  963 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/clear ]; then
  964     run_install $OWNERSHIP -m 0600 clear ${DESTDIR}${CONFDIR}/${PRODUCT}/clear
  965     echo "Clear file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/clear"
  966 fi
  967 #
  968 # Install the Isusable file
  969 #
  970 run_install $OWNERSHIP -m 0644 isusable ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/isusable
  971 #
  972 # Install the Refresh file
  973 #
  974 run_install $OWNERSHIP -m 0644 refresh ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/refresh
  975 
  976 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/refresh ]; then
  977     run_install $OWNERSHIP -m 0600 refresh ${DESTDIR}${CONFDIR}/${PRODUCT}/refresh
  978     echo "Refresh file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/refresh"
  979 fi
  980 #
  981 # Install the Refreshed file
  982 #
  983 run_install $OWNERSHIP -m 0644 refreshed ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/refreshed
  984 
  985 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/refreshed ]; then
  986     run_install $OWNERSHIP -m 0600 refreshed ${DESTDIR}${CONFDIR}/${PRODUCT}/refreshed
  987     echo "Refreshed file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/refreshed"
  988 fi
  989 #
  990 # Install the Tcclear file
  991 #
  992 run_install $OWNERSHIP -m 0644 tcclear           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
  993 
  994 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/tcclear ]; then
  995     run_install $OWNERSHIP -m 0600 tcclear ${DESTDIR}${CONFDIR}/${PRODUCT}/tcclear
  996     echo "Tcclear file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/tcclear"
  997 fi
  998 #
  999 # Install the Scfilter file
 1000 #
 1001 run_install $OWNERSHIP -m 0644 scfilter ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/scfilter
 1002 
 1003 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/scfilter ]; then
 1004     run_install $OWNERSHIP -m 0600 scfilter ${DESTDIR}${CONFDIR}/${PRODUCT}/scfilter
 1005     echo "Scfilter file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/scfilter"
 1006 fi
 1007 
 1008 #
 1009 # Install the Actions file
 1010 #
 1011 run_install $OWNERSHIP -m 0644 actions           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
 1012 run_install $OWNERSHIP -m 0644 actions.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
 1013 
 1014 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/actions ]; then
 1015     run_install $OWNERSHIP -m 0600 actions${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/actions
 1016     echo "Actions file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/actions"
 1017 fi
 1018 
 1019 #
 1020 # Install the Routes file
 1021 #
 1022 run_install $OWNERSHIP -m 0644 routes           ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
 1023 run_install $OWNERSHIP -m 0644 routes.annotated ${DESTDIR}${SHAREDIR}/${PRODUCT}/configfiles/
 1024 
 1025 if [ -z "$SPARSE" -a ! -f ${DESTDIR}${CONFDIR}/${PRODUCT}/routes ]; then
 1026     run_install $OWNERSHIP -m 0600 routes${suffix} ${DESTDIR}${CONFDIR}/${PRODUCT}/routes
 1027     echo "Routes file installed as ${DESTDIR}${CONFDIR}/${PRODUCT}/routes"
 1028 fi
 1029 
 1030 cd ..
 1031 
 1032 #
 1033 # Install the Action files
 1034 #
 1035 cd Actions
 1036 
 1037 for f in action.* ; do
 1038     case $f in
 1039     *.deprecated)
 1040         install_file $f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/${f%.*} 0644
 1041         echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/${f%.*}"
 1042         ;;
 1043     *)
 1044         install_file $f ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f 0644
 1045         echo "Action ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f"
 1046         ;;
 1047     esac
 1048 done
 1049 #
 1050 # Now the Macros
 1051 #
 1052 cd ../Macros
 1053 
 1054 for f in macro.* ; do
 1055     case $f in
 1056     *.deprecated)
 1057         install_file $f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/${f%.*} 0644
 1058         echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/${f%.*}"
 1059         ;;
 1060     *)
 1061         install_file $f ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f 0644
 1062         echo "Macro ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f"
 1063         ;;
 1064     esac
 1065 done
 1066 
 1067 cd ..
 1068 
 1069 #
 1070 # Install the libraries
 1071 #
 1072 for f in lib.* Perl/lib.*; do
 1073     if [ -f $f ]; then
 1074         case $f in
 1075             *installer)
 1076                 ;;
 1077             *)
 1078                 install_file $f ${DESTDIR}${SHAREDIR}/${PRODUCT}/$(basename $f) 0644
 1079                 echo "Library ${f#*.} file installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f"
 1080                 ;;
 1081         esac
 1082     fi
 1083 done
 1084 
 1085 if [ ${PRODUCT} = shorewall6 ]; then
 1086     #
 1087     # Symbolically link 'functions' to lib.base
 1088     #
 1089     ln -sf lib.base ${DESTDIR}${SHAREDIR}/${PRODUCT}/functions
 1090     #
 1091     # And create a symbolic link for the CLI
 1092     #
 1093     ln -sf shorewall ${DESTDIR}${SBINDIR}/shorewall6
 1094 fi
 1095 
 1096 if [ -d Perl ]; then
 1097     #
 1098     # ${SHAREDIR}/${PRODUCT}/$Product if needed
 1099     #
 1100     make_parent_directory ${DESTDIR}${SHAREDIR}/${PRODUCT}/$Product 0755
 1101     #
 1102     # Install the Compiler
 1103     #
 1104     cd Perl
 1105 
 1106     install_file compiler.pl ${DESTDIR}${LIBEXECDIR}/${PRODUCT}/compiler.pl 0755
 1107 
 1108     echo
 1109     echo "Compiler installed in ${DESTDIR}${LIBEXECDIR}/${PRODUCT}/compiler.pl"
 1110     #
 1111     # Install the params file helper
 1112     #
 1113     install_file getparams ${DESTDIR}${LIBEXECDIR}/${PRODUCT}/getparams 0755
 1114     [ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${LIBEXECDIR}/${PRODUCT}/getparams
 1115 
 1116     echo
 1117     echo "Params file helper installed in ${DESTDIR}${LIBEXECDIR}/${PRODUCT}/getparams"
 1118     #
 1119     # Install the Perl modules
 1120     #
 1121     for f in $Product/*.pm ; do
 1122     install_file $f ${DESTDIR}${PERLLIBDIR}/$f 0644
 1123     echo "Module ${f%.*} installed as ${DESTDIR}${PERLLIBDIR}/$f"
 1124     done
 1125 
 1126     [ -f Perl/Shorewall/Chains.pm.bak ] && mv Perl/Shorewall/Chains.pm.bak Perl/Shorewall/Chains.pm
 1127     [ -f Perl/Shorewall/Config.pm.bak ] && mv Perl/Shorewall/Config.pm.bak Perl/Shorewall/Config.pm
 1128 
 1129     #
 1130     # Install the program skeleton files
 1131     #
 1132     for f in prog.* ; do
 1133         install_file $f ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f 0644
 1134         echo "Program skeleton file ${f#*.} installed as ${DESTDIR}${SHAREDIR}/${PRODUCT}/$f"
 1135     done
 1136 
 1137     cd ..
 1138 
 1139     if [ -z "$DESTDIR" ]; then
 1140     rm -rf ${SHAREDIR}/${PRODUCT}-perl
 1141     rm -rf ${SHAREDIR}/${PRODUCT}-shell
 1142     [ "$PERLLIBDIR" != ${SHAREDIR}/${PRODUCT} ] && rm -rf ${SHAREDIR}/${PRODUCT}/$Product
 1143     fi
 1144 fi
 1145 #
 1146 # Create the version file
 1147 #
 1148 echo "$VERSION" > ${DESTDIR}${SHAREDIR}/${PRODUCT}/version
 1149 chmod 0644 ${DESTDIR}${SHAREDIR}/${PRODUCT}/version
 1150 #
 1151 # Remove and create the symbolic link to the init script
 1152 #
 1153 
 1154 if [ -z "${DESTDIR}" -a -n "${INITFILE}" ]; then
 1155     rm -f ${SHAREDIR}/${PRODUCT}/init
 1156     ln -s ${INITDIR}/${INITFILE} ${SHAREDIR}/${PRODUCT}/init
 1157 fi
 1158 
 1159 #
 1160 # Install the Man Pages
 1161 #
 1162 
 1163 if [ -n "$MANDIR" ]; then
 1164 
 1165 cd manpages
 1166 
 1167 if [ ${PRODUCT} = shorewall ]; then
 1168     [ -n "$INSTALLD" ] || make_parent_directory ${DESTDIR}${MANDIR}/man5 0755
 1169 
 1170     for f in *.5; do
 1171     gzip -9c $f > $f.gz
 1172     run_install $INSTALLD  -m 0644 $f.gz ${DESTDIR}${MANDIR}/man5/$f.gz
 1173     echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
 1174     done
 1175 fi
 1176 
 1177 if [ ${PRODUCT} = shorewall6 ]; then
 1178     make_parent_directory ${DESTDIR}${MANDIR}/man5 0755
 1179 
 1180     rm -f ${DESTDIR}${MANDIR}/man5/shorewall6*
 1181 
 1182     for f in \
 1183     shorewall-accounting.5  shorewall-ipsets.5   shorewall-providers.5     shorewall-tcclasses.5     \
 1184     shorewall-actions.5     shorewall-maclist.5                            shorewall-tcdevices.5     \
 1185                             shorewall-mangle.5   shorewall-proxyndp.5      shorewall-tcfilters.5     \
 1186     shorewall-blacklist.5   shorewall-masq.5     shorewall-routes.5        shorewall-tcinterfaces.5  \
 1187     shorewall-blrules.5     shorewall-modules.5  shorewall-routestopped.5  shorewall-tcpri.5         \
 1188     shorewall-conntrack.5   shorewall-nat.5      shorewall-rtrules.5       shorewall-tcrules.5       \
 1189                                 shorewall-nesting.5  shorewall-rules.5         shorewall-tos.5           \
 1190     shorewall-exclusion.5   shorewall-netmap.5   shorewall-secmarks.5      shorewall-tunnels.5       \
 1191     shorewall-hosts.5       shorewall-params.5   shorewall-snat.5          shorewall-vardir.5        \
 1192     shorewall-interfaces.5  shorewall-policy.5   shorewall-stoppedrules.5  shorewall-zones.5
 1193     do
 1194     f6=shorewall6-${f#*-}
 1195     echo ".so man5/$f" > ${DESTDIR}${MANDIR}/man5/$f6
 1196     done
 1197 
 1198     echo ".so man5/shorewall.conf.5" > ${DESTDIR}${MANDIR}/man5/shorewall6.conf.5
 1199 fi
 1200 
 1201 [ -n "$INSTALLD" ] || make_parent_directory ${DESTDIR}${MANDIR}/man8 0755
 1202 
 1203 for f in *.8; do
 1204     gzip -9c $f > $f.gz
 1205     run_install $INSTALLD  -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
 1206     echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
 1207 done
 1208 
 1209 cd ..
 1210 
 1211 echo "Man Pages Installed"
 1212 fi
 1213 
 1214 if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
 1215     run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}
 1216     echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}"
 1217 fi
 1218 
 1219 #
 1220 # Note -- not all packages will have the SYSCONFFILE so we need to check for its existance here
 1221 #
 1222 if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
 1223     if [ ${DESTDIR} ]; then
 1224     make_parent_directory ${DESTDIR}${SYSCONFDIR} 0755
 1225     fi
 1226 
 1227     run_install $OWNERSHIP -m 0644 ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT}
 1228     echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
 1229 fi
 1230 
 1231 #
 1232 # Remove deleted actions and macros
 1233 #
 1234 if [ $PRODUCT = shorewall ]; then
 1235     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/action.A_AllowICMPs
 1236     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/action.A_Drop
 1237     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/action.A_Reject
 1238     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/action.Drop
 1239     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/action.Reject
 1240 
 1241     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/deprecated/macro.SMTPTraps
 1242 fi
 1243 
 1244 #
 1245 # Remove unneeded modules files
 1246 #
 1247 
 1248 if [ -n "$first_install" ]; then
 1249     rm -f ${DESTDIR}${SHAREDIR}/${PRODUCT}/modules*
 1250 fi
 1251 
 1252 if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then
 1253     if [ -n "$SERVICEDIR" ]; then
 1254     if systemctl enable ${PRODUCT}.service; then
 1255         echo "$Product will start automatically at boot"
 1256     fi
 1257     elif mywhich insserv; then
 1258     if insserv ${CONFDIR}/init.d/${PRODUCT} ; then
 1259         echo "${PRODUCT} will start automatically at boot"
 1260         if [ $HOST = debian ]; then
 1261         echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable"
 1262         touch /var/log/${PRODUCT}-init.log
 1263         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
 1264         else
 1265         echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable"
 1266         fi
 1267     else
 1268         cant_autostart
 1269     fi
 1270     elif mywhich chkconfig; then
 1271     if chkconfig --add ${PRODUCT} ; then
 1272         echo "${PRODUCT} will start automatically in run levels as follows:"
 1273         echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable"
 1274         chkconfig --list ${PRODUCT}
 1275     else
 1276         cant_autostart
 1277     fi
 1278     elif mywhich update-rc.d ; then
 1279     echo "${PRODUCT} will start automatically at boot"
 1280     echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable"
 1281     touch /var/log/${PRODUCT}-init.log
 1282     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
 1283     update-rc.d ${PRODUCT} enable
 1284     elif mywhich rc-update ; then
 1285     if rc-update add ${PRODUCT} default; then
 1286         echo "${PRODUCT} will start automatically at boot"
 1287         if [ $HOST = debian ]; then
 1288         echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable"
 1289         touch /var/log/${PRODUCT}-init.log
 1290         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
 1291         else
 1292         echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable"
 1293         fi
 1294     else
 1295         cant_autostart
 1296     fi
 1297     elif [ "$INITFILE" != rc.f ]; then #Slackware starts this automatically
 1298     cant_autostart
 1299     fi
 1300 fi
 1301 
 1302 #
 1303 # Report Success
 1304 #
 1305 echo "$Product Version $VERSION Installed"