Hi Tom, attached are the changes I've done to get shorewall-init
working on openwrt and fixing/adding one or two things(made 5.0.4's
way)!:
All install.sh scripts have now:
- PRODUCT=...-...
- Product="... ..."
- cd "$dirname $0)"
All uninstall.sh scripts have now:
- PRODUCT=...-...
- Product="... ..."
- cd "$dirname $0)"
- rm -rf ${VARDIR} instead of rm -rf ${VARDIR}/$PRODUCT($PRODUCT not
needed with $VARDIR)
- Removed unnecessary line: [ -n $SYSTEMD ] && rm -f
$SYSTEMD/$PRODUCT.service
shorewall6/uninstall.sh
- duplicate line removed:
rm -rf ${CONFDIR}/shorewall6
Openwrt related:
- Modified shorewallrc.openwrt
shorewall-core:
install.sh
- The manpages will not be installed if the variable MANDIR is
empty(not that useful on openwrt):
if [ -n "${MANDIR}" ]; then
..
fi
shorewall[6]-lite:
- Improvements/changes were made to default.openwrt(renamed
sysconfig) and the init.openwrt.sh scripts
install.sh
- If statement changed from:
if [ -d $MANDIR ]; then
to
if [ -d $MANDIR -a -n "${MANDIR}" ]; then
uninstall.sh
- Added the folowing:
if [ -n "${MANDIR}" ]; then
..
fi
shorewall-init:
install.sh:
- Added support for openwrt (detecting the build system ..., echo
"Installing openwrt-specific ...)
- The install utility is no longer used(based on what has been done
for shorewall lite)
- Added support for enabling init script at boot
- Else if clause added in if statement when $RPM is empty(437)
- No ifupdown script made; so in step "install ifupdown script" an if
statement was added(line 461)
- Created init script(init.openwrt.sh)
uninstall.sh
- Added support for disabling and removing init script
- Added an if statement because readlink on openwrt does not have the
"-m" option.
-Matt
On 27 Dec 2015 at 16:16, Tom Eastep wrote:
> On 12/27/2015 03:08 PM, matt darfeuille wrote:
> > Hi tom, indeed shorewall-init-5.0.3-Beta2 is now starting at
> > boot!!!:)
> >
> > A quick question though:
> >
> > In eatch packets shorewallrc.openwrt is included, but
> > shorewall-init/install.sh will try to install
> > ${SYSCONFFILE}(default.openwrt) even though it should copy the
> > sysconfig file.
> >
> > So my question is:
> >
> > Should I modify the SYSCONFFILE var in shorewall-init/default.openwrt
> > to:
> > SYSCONFFILE=sysconfig
> > or should I modify shorewall-init/install.sh to ignore the value of
> > $SYSCONFFILE:
> > from
> > ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT
> > to
> > sysconfig ${DESTDIR}${SYSCONFDIR}/$PRODUCT
> >
> > In other words:
> > Should shorewallrc.openwrt be the same in eatch packets?
>
> For 5.0.3, we will modify shorewall-init/install.sh. For 5.0.4, we will
> do it right and:
>
> - rename the default.openwrt files to sysconfig
> - add the sysconfig files to Shorewall and Shorewall6
> - back out the change to shorewall-init/install.sh
> - modify shorewallrc.openwrt to specify SYSCONFFILE=sysconfig
>
> -Tom
> --
> Tom Eastep \ When I die, I want to go like my Grandfather who
> Shoreline, \ died peacefully in his sleep. Not screaming like
> Washington, USA \ all of the passengers in his car
> http://shorewall.net \________________________________________________
>
>
-------------- Enclosure number 1 ----------------
diff --git a/shorewall-core/install.sh b/shorewall-core/install.sh
index 324dbc2..3cc1bed 100755
--- a/shorewall-core/install.sh
+++ b/shorewall-core/install.sh
@@ -23,6 +23,8 @@
#
VERSION=5.0.3-Beta2
+PRODUCT=shorewall-core
+Product="Shorewall Core"
usage() # $1 = exit status
{
@@ -100,6 +102,9 @@ require()
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
}
+#
+# Change to the directory containing this script
+#
cd "$(dirname $0)"
#
@@ -340,8 +345,10 @@ fi
mkdir -p ${DESTDIR}${SBINDIR}
chmod 755 ${DESTDIR}${SBINDIR}
+if [ -n "${MANDIR}" ]; then
mkdir -p ${DESTDIR}${MANDIR}
chmod 755 ${DESTDIR}${MANDIR}
+fi
if [ -n "${INITFILE}" ]; then
mkdir -p ${DESTDIR}${INITDIR}
diff --git a/shorewall-core/shorewallrc.openwrt
b/shorewall-core/shorewallrc.openwrt
index 1f227eb..5f0809f 100644
--- a/shorewall-core/shorewallrc.openwrt
+++ b/shorewall-core/shorewallrc.openwrt
@@ -1,26 +1,23 @@
#
-# Created by Shorewall Core version 5.0.2-RC1 configure - Fri, Nov 06, 2015
10:02:03 AM
-#
-# Input: host=openwrt
+# Openwrt Shorewall 5.0 rc file
#
+BUILD= #Default is to detect the build system
HOST=openwrt
-PREFIX=/usr
-SHAREDIR=${PREFIX}/share
-LIBEXECDIR=${PREFIX}/share
-PERLLIBDIR=${PREFIX}/share/shorewall
-CONFDIR=/etc
-SBINDIR=/sbin
-MANDIR=${PREFIX}/man
-INITDIR=/etc/init.d
-INITSOURCE=init.openwrt.sh
-INITFILE=$PRODUCT
-AUXINITSOURCE=
-AUXINITFILE=
-SERVICEDIR=
-SERVICEFILE=
-SYSCONFFILE=default.openwrt
-SYSCONFDIR=${CONFDIR}/sysconfig
-SPARSE=
-ANNOTATED=
-VARLIB=/lib
-VARDIR=${VARLIB}/$PRODUCT
+PREFIX=/usr #Top-level directory for shared files,
libraries, etc.
+SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
+LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
+PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl
module directory
+CONFDIR=/etc #Directory where subsystem
configurations are installed
+SBINDIR=/sbin #Directory where system administration
programs are installed
+MANDIR= #Directory where manpages are installed.
+INITDIR=/etc/init.d #Directory where SysV init scripts are
installed.
+INITFILE=$PRODUCT #Name of the product's installed SysV
init script
+INITSOURCE=init.openwrt.sh #Name of the distributed file to be
installed as the SysV init script
+ANNOTATED= #If non-zero, annotated configuration
files are installed
+SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init
parameter files are installed
+SYSCONFFILE=sysconfig #Name of the distributed file to be
installed in $SYSCONFDIR
+SERVICEDIR= #Directory where .service files are
installed (systems running systemd only)
+SERVICEFILE= #Name of the file to install in
$SYSTEMD. Default is $PRODUCT.service
+SPARSE= #If non-empty, only install
$PRODUCT/$PRODUCT.conf in $CONFDIR
+VARLIB=/lib #Directory where product variable data is
stored.
+VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data
is stored.
diff --git a/shorewall-core/uninstall.sh b/shorewall-core/uninstall.sh
index 4ceeb00..dbb1a95 100755
--- a/shorewall-core/uninstall.sh
+++ b/shorewall-core/uninstall.sh
@@ -27,6 +27,8 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=5.0.3-Beta2
+PRODUCT="shorewall-core"
+Product="Shorewall Core"
usage() # $1 = exit status
{
@@ -67,6 +69,11 @@ remove_file() # $1 = file to restore
}
#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
+
+#
# Read the RC file
#
if [ $# -eq 0 ]; then
diff --git a/shorewall-init/init.openwrt.sh b/shorewall-init/init.openwrt.sh
new file mode 100755
index 0000000..76e8947
--- /dev/null
+++ b/shorewall-init/init.openwrt.sh
@@ -0,0 +1,130 @@
+#!/bin/sh /etc/rc.common
+# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V5.0
+#
+# (c) 2010,2012-2014 - Tom Eastep ([email protected])
+#
+# On most distributions, this file should be called
/etc/init.d/shorewall-init.
+#
+# 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.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
+#
+#
+
+# arg1 of init script is arg2 when rc.common is sourced
+
+case "$action" in
+ start|stop|boot)
+if [ "$(id -u)" != "0" ]
+then
+ echo "You must be root to start, stop or restart \"Shorewall \"."
+ exit 1
+fi
+
+# check if shorewall-init is configured or not
+if [ -f "/etc/sysconfig/shorewall-init" ]
+then
+ . /etc/sysconfig/shorewall-init
+ if [ -z "$PRODUCTS" ]
+ then
+ exit 0
+ fi
+else
+ exit 0
+fi
+
+ ;;
+enable|disable|enabled)
+# Openwrt related
+# start and stop runlevel variable
+START=19
+STOP=91
+;;
+ *)
+ echo "Usage: /etc/init.d/shorewall-init {start|stop}"
+ exit 1
+esac
+
+#
+# The installer may alter this
+#
+. /usr/share/shorewall/shorewallrc
+
+# Locate the current PRODUCT's statedir
+setstatedir() {
+ local statedir
+ if [ -f ${CONFDIR}/${PRODUCT}/vardir ]; then
+ statedir=$( . ${CONFDIR}/${PRODUCT}/vardir && echo $VARDIR )
+ fi
+
+ [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT}
+
+ if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
+ ${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall
+ else
+ return 0
+ fi
+}
+
+# Initialize the firewall
+start () {
+ local PRODUCT
+ local STATEDIR
+
+ echo -n "Initializing \"Shorewall-based firewalls\": "
+ for PRODUCT in $PRODUCTS; do
+ if setstatedir; then
+ if [ -x ${STATEDIR}/firewall ]; then
+ if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then
+ ${STATEDIR}/firewall ${OPTIONS} stop
+ fi
+ fi
+ fi
+ done
+
+ if [ -n "$SAVE_IPSETS" -a -f "$SAVE_IPSETS" ]; then
+ ipset -R < "$SAVE_IPSETS"
+ fi
+}
+
+boot () {
+start
+}
+
+# Clear the firewall
+stop () {
+ local PRODUCT
+ local STATEDIR
+
+ echo -n "Clearing \"Shorewall-based firewalls\": "
+ for PRODUCT in $PRODUCTS; do
+ if setstatedir; then
+ if [ -x ${STATEDIR}/firewall ]; then
+ ${STATEDIR}/firewall ${OPTIONS} clear
+ fi
+ fi
+ done
+
+ if [ -n "$SAVE_IPSETS" ]; then
+ mkdir -p $(dirname "$SAVE_IPSETS")
+ if ipset -S > "${SAVE_IPSETS}.tmp"; then
+ grep -qE -- '^(-N|create )' "${SAVE_IPSETS}.tmp" && mv -f
"${SAVE_IPSETS}.tmp" "$SAVE_IPSETS"
+ fi
+ fi
+}
+
diff --git a/shorewall-init/install.sh b/shorewall-init/install.sh
index 899cdc4..d6603af 100755
--- a/shorewall-init/install.sh
+++ b/shorewall-init/install.sh
@@ -28,6 +28,8 @@
#
VERSION=5.0.3-Beta2
+PRODUCT=shorewall-init
+Product="Shorewall Init"
usage() # $1 = exit status
{
@@ -71,39 +73,51 @@ mywhich() {
return 2
}
-run_install()
-{
- if ! install $*; then
- echo
- echo "ERROR: Failed to install $*" >&2
- exit 1
- fi
-}
-
cant_autostart()
{
echo
echo "WARNING: Unable to configure shorewall init to start automatically
at boot" >&2
}
-require()
+install_file() # $1 = source $2 = target $3 = mode
{
- eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
+ if cp -f $1 $2; then
+ if chmod $3 $2; then
+ if [ -n "$OWNER" ]; then
+ if chown $OWNER:$GROUP $2; then
+ return
+ fi
+ else
+ return 0
+ fi
+ fi
+ fi
+
+ echo "ERROR: Failed to install $2" >&2
+ exit 1
}
-install_file() # $1 = source $2 = target $3 = mode
+make_directory() # $1 = directory , $2 = mode
{
- run_install $T $OWNERSHIP -m $3 $1 ${2}
+ mkdir -p $1
+ chmod 0755 $1
+ [ -n "$OWNERSHIP" ] && chown $OWNERSHIP $1
+
}
-cd "$(dirname $0)"
+require()
+{
+ eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
+}
-PRODUCT=shorewall-init
+#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
#
# Parse the run line
#
-T='-T'
finished=0
configure=1
@@ -230,6 +244,8 @@ if [ -z "$BUILD" ]; then
BUILD=slackware
elif [ -f /etc/arch-release ] ; then
BUILD=archlinux
+elif [ -f /etc/openwrt_release ]; then
+BUILD=openwrt
else
BUILD=linux
fi
@@ -237,22 +253,24 @@ if [ -z "$BUILD" ]; then
esac
fi
-[ -n "$OWNER" ] || OWNER=$(id -un)
-[ -n "$GROUP" ] || GROUP=$(id -gn)
-
case $BUILD in
- apple)
- T=
+ cygwin*|CYGWIN*)
+ OWNER=$(id -un)
+ GROUP=$(id -gn)
;;
- debian|gentoo|redhat|suse|slackware|archlinux)
+ apple)
+ [ -z "$OWNER" ] && OWNER=root
+ [ -z "$GROUP" ] && GROUP=wheel
;;
*)
- [ -n "$BUILD" ] && echo "ERROR: Unknown BUILD environment ($BUILD)" >&2
|| echo "ERROR: Unknown BUILD environment"
- exit 1
+ if [ $(id -u) -eq 0 ]; then
+ [ -z "$OWNER" ] && OWNER=root
+ [ -z "$GROUP" ] && GROUP=root
+ fi
;;
esac
-OWNERSHIP="-o $OWNER -g $GROUP"
+[ -n "$OWNER" ] && OWNERSHIP="$OWNER:$GROUP"
[ -n "$HOST" ] || HOST=$BUILD
@@ -277,6 +295,9 @@ case "$HOST" in
suse)
echo "Installing SuSE-specific configuration..."
;;
+openwrt)
+ echo "Installing Openwrt-specific configuration..."
+;;
linux)
echo "ERROR: Shorewall-init is not supported on this system" >&2
exit 1
@@ -290,12 +311,12 @@ esac
[ -z "$TARGET" ] && TARGET=$HOST
if [ -n "$DESTDIR" ]; then
- if [ `id -u` != 0 ] ; then
+ if [ $(id -u) != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
fi
- install -d $OWNERSHIP -m 755 ${DESTDIR}${INITDIR}
+ make_directory ${DESTDIR}${INITDIR} 0755
fi
echo "Installing Shorewall Init Version $VERSION"
@@ -311,7 +332,7 @@ fi
if [ -n "$DESTDIR" ]; then
mkdir -p ${DESTDIR}${CONFDIR}/logrotate.d
- chmod 755 ${DESTDIR}${CONFDIR}/logrotate.d
+ chmod 0755 ${DESTDIR}${CONFDIR}/logrotate.d
fi
#
@@ -339,14 +360,14 @@ fi
if [ -n "$SERVICEDIR" ]; then
mkdir -p ${DESTDIR}${SERVICEDIR}
[ -z "$SERVICEFILE" ] && SERVICEFILE=$PRODUCT.service
- run_install $OWNERSHIP -m 644 $SERVICEFILE
${DESTDIR}${SERVICEDIR}/$PRODUCT.service
+install_file $SERVICEFILE ${DESTDIR}${SERVICEDIR}/$PRODUCT.service 0644
[ ${SBINDIR} != /sbin ] && eval sed -i \'s\|/sbin/\|${SBINDIR}/\|\'
${DESTDIR}${SERVICEDIR}/$PRODUCT.service
echo "Service file $SERVICEFILE installed as
${DESTDIR}${SERVICEDIR}/$PRODUCT.service"
if [ -n "$DESTDIR" -o $configure -eq 0 ]; then
mkdir -p ${DESTDIR}${SBINDIR}
- chmod 755 ${DESTDIR}${SBINDIR}
+ chmod 0755 ${DESTDIR}${SBINDIR}
fi
- run_install $OWNERSHIP -m 700 shorewall-init
${DESTDIR}${SBINDIR}/shorewall-init
+install_file shorewall-init ${DESTDIR}${SBINDIR}/shorewall-init 0700
[ "${SHAREDIR}" = /usr/share ] || eval sed -i
\'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall-init
echo "CLI installed as ${DESTDIR}${SBINDIR}/shorewall-init"
fi
@@ -355,13 +376,13 @@ fi
# Create /usr/share/shorewall-init if needed
#
mkdir -p ${DESTDIR}${SHAREDIR}/shorewall-init
-chmod 755 ${DESTDIR}${SHAREDIR}/shorewall-init
+chmod 0755 ${DESTDIR}${SHAREDIR}/shorewall-init
#
# Install logrotate file
#
if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then
- run_install $OWNERSHIP -m 0644 logrotate
${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT
+install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT 0644
echo "Logrotate file installed as
${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT"
fi
@@ -369,7 +390,7 @@ fi
# Create the version file
#
echo "$VERSION" > ${DESTDIR}/${SHAREDIR}/shorewall-init/version
-chmod 644 ${DESTDIR}${SHAREDIR}/shorewall-init/version
+chmod 0644 ${DESTDIR}${SHAREDIR}/shorewall-init/version
#
# Remove and create the symbolic link to the init script
@@ -412,6 +433,9 @@ else
elif [ $HOST = gentoo ]; then
# Gentoo does not support if-{up,down}.d
/bin/true
+elif [ $HOST = openwrt ]; then
+# Not implemented on openwrt
+/bin/true
else
mkdir -p ${DESTDIR}/${ETC}/NetworkManager/dispatcher.d
fi
@@ -419,8 +443,8 @@ else
fi
if [ -n "$SYSCONFFILE" -a ! -f ${DESTDIR}${SYSCONFDIR}/${PRODUCT} ]; then
- run_install $OWNERSHIP -m 0644 ${SYSCONFFILE}
${DESTDIR}${SYSCONFDIR}/$PRODUCT
- echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/$PRODUCT 0644
+ echo "${SYSCONFFILE} file installed in
${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
[ $HOST = suse ] && IFUPDOWN=ifupdown.suse.sh ||
IFUPDOWN=ifupdown.fedora.sh
@@ -430,6 +454,7 @@ fi
# Install the ifupdown script
#
+if [ $HOST != openwrt ]; then
cp $IFUPDOWN ifupdown
[ "${SHAREDIR}" = /usr/share ] || eval sed -i
\'s\|/usr/share/\|${SHAREDIR}/\|\' ifupdown
@@ -437,6 +462,7 @@ cp $IFUPDOWN ifupdown
mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init
install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544
+fi
if [ -d ${DESTDIR}/etc/NetworkManager ]; then
[ $configure -eq 1 ] || mkdir -p
${DESTDIR}${CONFDIR}/NetworkManager/dispatcher.d/
@@ -511,6 +537,13 @@ if [ -z "$DESTDIR" ]; then
else
cant_autostart
fi
+ elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then
+ /etc/init.d/$PRODUCT enable
+ if /etc/init.d/$PRODUCT enabled; then
+ echo "$Product will start automatically at boot"
+ else
+ cant_autostart
+ fi
elif [ $HOST = gentoo ]; then
# On Gentoo, a service must be enabled manually by the user,
# not by the installer
diff --git a/shorewall-init/shorewallrc.openwrt
b/shorewall-init/shorewallrc.openwrt
index 1f227eb..5f0809f 100644
--- a/shorewall-init/shorewallrc.openwrt
+++ b/shorewall-init/shorewallrc.openwrt
@@ -1,26 +1,23 @@
#
-# Created by Shorewall Core version 5.0.2-RC1 configure - Fri, Nov 06, 2015
10:02:03 AM
-#
-# Input: host=openwrt
+# Openwrt Shorewall 5.0 rc file
#
+BUILD= #Default is to detect the build system
HOST=openwrt
-PREFIX=/usr
-SHAREDIR=${PREFIX}/share
-LIBEXECDIR=${PREFIX}/share
-PERLLIBDIR=${PREFIX}/share/shorewall
-CONFDIR=/etc
-SBINDIR=/sbin
-MANDIR=${PREFIX}/man
-INITDIR=/etc/init.d
-INITSOURCE=init.openwrt.sh
-INITFILE=$PRODUCT
-AUXINITSOURCE=
-AUXINITFILE=
-SERVICEDIR=
-SERVICEFILE=
-SYSCONFFILE=default.openwrt
-SYSCONFDIR=${CONFDIR}/sysconfig
-SPARSE=
-ANNOTATED=
-VARLIB=/lib
-VARDIR=${VARLIB}/$PRODUCT
+PREFIX=/usr #Top-level directory for shared files,
libraries, etc.
+SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
+LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
+PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl
module directory
+CONFDIR=/etc #Directory where subsystem
configurations are installed
+SBINDIR=/sbin #Directory where system administration
programs are installed
+MANDIR= #Directory where manpages are installed.
+INITDIR=/etc/init.d #Directory where SysV init scripts are
installed.
+INITFILE=$PRODUCT #Name of the product's installed SysV
init script
+INITSOURCE=init.openwrt.sh #Name of the distributed file to be
installed as the SysV init script
+ANNOTATED= #If non-zero, annotated configuration
files are installed
+SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init
parameter files are installed
+SYSCONFFILE=sysconfig #Name of the distributed file to be
installed in $SYSCONFDIR
+SERVICEDIR= #Directory where .service files are
installed (systems running systemd only)
+SERVICEFILE= #Name of the file to install in
$SYSTEMD. Default is $PRODUCT.service
+SPARSE= #If non-empty, only install
$PRODUCT/$PRODUCT.conf in $CONFDIR
+VARLIB=/lib #Directory where product variable data is
stored.
+VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data
is stored.
diff --git a/shorewall-init/uninstall.sh b/shorewall-init/uninstall.sh
index add0f65..ceb2aa3 100755
--- a/shorewall-init/uninstall.sh
+++ b/shorewall-init/uninstall.sh
@@ -27,6 +27,8 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=5.0.3-Beta2
+PRODUCT=shorewall-init
+Product="Shorewall Init"
usage() # $1 = exit status
{
@@ -75,6 +77,11 @@ remove_file() # $1 = file to restore
fi
}
+#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
+
finished=0
configure=1
@@ -159,10 +166,14 @@ echo "Uninstalling Shorewall Init $VERSION"
[ -n "$SANDBOX" ] && configure=0
INITSCRIPT=${CONFDIR}/init.d/shorewall-init
-
+
if [ -f "$INITSCRIPT" ]; then
if [ $configure -eq 1 ]; then
- if mywhich updaterc.d ; then
+ if [ $HOST = openwrt ]; then
+ if /etc/init.d/shorewall-init enabled; then
+ /etc/init.d/shorewall-init disable
+ fi
+ elif mywhich updaterc.d ; then
updaterc.d shorewall-init remove
elif mywhich insserv ; then
insserv -r $INITSCRIPT
@@ -183,8 +194,13 @@ if [ -n "$SERVICEDIR" ]; then
rm -f $SERVICEDIR/shorewall-init.service
fi
+if [ $HOST = openwrt ]; then
+[ "$(readlink -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] &&
remove_file ${SBINDIR}/ifup-local
+[ "$(readlink -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] &&
remove_file ${SBINDIR}/ifdown-local
+else
[ "$(readlink -m -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ]
&& remove_file ${SBINDIR}/ifup-local
[ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ]
&& remove_file ${SBINDIR}/ifdown-local
+fi
remove_file ${CONFDIR}/default/shorewall-init
remove_file ${CONFDIR}/sysconfig/shorewall-init
@@ -198,8 +214,6 @@ remove_file ${CONFDIR}/network/if-post-down.d/shorewall
remove_file ${CONFDIR}/sysconfig/network/if-up.d/shorewall
remove_file ${CONFDIR}/sysconfig/network/if-down.d/shorewall
-[ -n "$SYSTEMD" ] && remove_file ${SYSTEMD}/shorewall.service
-
if [ -d ${CONFDIR}/ppp ]; then
for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do
remove_file ${CONFDIR}/ppp/$directory/shorewall
diff --git a/shorewall-lite/default.openwrt b/shorewall-lite/default.openwrt
deleted file mode 100644
index df4440b..0000000
--- a/shorewall-lite/default.openwrt
+++ /dev/null
@@ -1,25 +0,0 @@
-# sysV init file script configuration(/etc/sysconfdir/shorewall-lite)
-
-# startup option(default "-vvv")
-OPTIONS=
-
-# change default start run level(if none empty; /etc/init.d/shorewall-lite
enable)
-START=50
-
-# change default stop run level(if none empty; /etc/init.d/shorewall-lite
enable)
-STOP=
-
-# option to pass when shorewall start is executed
-STARTOPTIONS=
-
-# option to pass when shorewall restart is executed
-RESTARTOPTIONS=
-
-# option to pass when shorewall reload is executed
-RELOADOPTIONS=
-
-# option to pass when shorewall stop is executed
-STOPOPTIONS=
-
-# option to pass when shorewall status is executed
-STATUSOPTIONS=
diff --git a/shorewall-lite/init.openwrt.sh b/shorewall-lite/init.openwrt.sh
index 68c2c73..3e625ac 100755
--- a/shorewall-lite/init.openwrt.sh
+++ b/shorewall-lite/init.openwrt.sh
@@ -32,38 +32,37 @@
# shorewall-lite start Starts the firewall
# shorewall-lite restart Restarts the firewall
# shorewall-lite reload Reload the firewall
-# (same as restart)
# shorewall-lite stop Stops the firewall
# shorewall-lite status Displays firewall status
#
# description: Packet filtering firewall
-# openwrt stuph
+# Product name variable
+PRODUCT=shorewall-lite
+
+# Openwrt related
# start and stop runlevel variable
-#START=21
-#STOP=91
-# variable to display what the status command do when
/etc/init.d/shorewall-lite is invoke without argument
+START=50
+STOP=89
+# Displays the status command
EXTRA_COMMANDS="status"
-EXTRA_HELP="Displays shorewall status"
+EXTRA_HELP=" status Displays firewall status"
################################################################################
# Get startup options (override default)
################################################################################
-OPTIONS="-vvv"
+OPTIONS=
#
# The installer may alter this
#
. /usr/share/shorewall/shorewallrc
-if [ -f ${SYSCONFDIR}/shorewall-lite ]; then
- . ${SYSCONFDIR}/shorewall-lite
+if [ -f ${SYSCONFDIR}/$PRODUCT ]; then
+ . ${SYSCONFDIR}/$PRODUCT
fi
-START=${START:-21}
-STOP=${STOP:-91}
-
SHOREWALL_INIT_SCRIPT=1
################################################################################
@@ -73,26 +72,26 @@ SHOREWALL_INIT_SCRIPT=1
command="$action"
start() {
- exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${STARTOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $STARTOPTIONS
}
boot() {
-local command="start"
+local command=start
start
}
restart() {
- exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${RESTARTOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $RESTARTOPTIONS
}
reload() {
- exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${RELOADOPTION:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $RELOADOPTION
}
stop() {
- exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${STOPOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $STOPOPTIONS
}
status() {
- exec ${SBINDIR}/shorewall-lite $OPTIONS $command ${STATUSOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $@
}
diff --git a/shorewall-lite/install.sh b/shorewall-lite/install.sh
index 3b44bf2..7919c34 100755
--- a/shorewall-lite/install.sh
+++ b/shorewall-lite/install.sh
@@ -23,6 +23,8 @@
#
VERSION=5.0.3-Beta2
+PRODUCT=shorewall-lite
+Product="Shorewall Lite"
usage() # $1 = exit status
{
@@ -114,14 +116,6 @@ require()
#
cd "$(dirname $0)"
-if [ -f shorewall-lite ]; then
- PRODUCT=shorewall-lite
- Product="Shorewall Lite"
-else
- PRODUCT=shorewall6-lite
- Product="Shorewall6 Lite"
-fi
-
#
# Parse the run line
#
@@ -495,7 +489,7 @@ done
# Install the Man Pages
#
-if [ -d manpages ]; then
+if [ -d manpages -a -n "${MANDIR}" ]; then
cd manpages
mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
@@ -550,7 +544,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f
${DESTDIR}${SYSCONFDIR}/${PR
fi
install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT} 0640
- echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+ echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ ${SHAREDIR} != /usr/share ]; then
diff --git a/shorewall-lite/shorewallrc.openwrt
b/shorewall-lite/shorewallrc.openwrt
index 1f227eb..5f0809f 100644
--- a/shorewall-lite/shorewallrc.openwrt
+++ b/shorewall-lite/shorewallrc.openwrt
@@ -1,26 +1,23 @@
#
-# Created by Shorewall Core version 5.0.2-RC1 configure - Fri, Nov 06, 2015
10:02:03 AM
-#
-# Input: host=openwrt
+# Openwrt Shorewall 5.0 rc file
#
+BUILD= #Default is to detect the build system
HOST=openwrt
-PREFIX=/usr
-SHAREDIR=${PREFIX}/share
-LIBEXECDIR=${PREFIX}/share
-PERLLIBDIR=${PREFIX}/share/shorewall
-CONFDIR=/etc
-SBINDIR=/sbin
-MANDIR=${PREFIX}/man
-INITDIR=/etc/init.d
-INITSOURCE=init.openwrt.sh
-INITFILE=$PRODUCT
-AUXINITSOURCE=
-AUXINITFILE=
-SERVICEDIR=
-SERVICEFILE=
-SYSCONFFILE=default.openwrt
-SYSCONFDIR=${CONFDIR}/sysconfig
-SPARSE=
-ANNOTATED=
-VARLIB=/lib
-VARDIR=${VARLIB}/$PRODUCT
+PREFIX=/usr #Top-level directory for shared files,
libraries, etc.
+SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
+LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
+PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl
module directory
+CONFDIR=/etc #Directory where subsystem
configurations are installed
+SBINDIR=/sbin #Directory where system administration
programs are installed
+MANDIR= #Directory where manpages are installed.
+INITDIR=/etc/init.d #Directory where SysV init scripts are
installed.
+INITFILE=$PRODUCT #Name of the product's installed SysV
init script
+INITSOURCE=init.openwrt.sh #Name of the distributed file to be
installed as the SysV init script
+ANNOTATED= #If non-zero, annotated configuration
files are installed
+SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init
parameter files are installed
+SYSCONFFILE=sysconfig #Name of the distributed file to be
installed in $SYSCONFDIR
+SERVICEDIR= #Directory where .service files are
installed (systems running systemd only)
+SERVICEFILE= #Name of the file to install in
$SYSTEMD. Default is $PRODUCT.service
+SPARSE= #If non-empty, only install
$PRODUCT/$PRODUCT.conf in $CONFDIR
+VARLIB=/lib #Directory where product variable data is
stored.
+VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data
is stored.
diff --git a/shorewall-lite/sysconfig b/shorewall-lite/sysconfig
new file mode 100644
index 0000000..490b968
--- /dev/null
+++ b/shorewall-lite/sysconfig
@@ -0,0 +1,16 @@
+# sysV init file script configuration(${SYSCONFDIR}/$PRODUCT)
+
+# startup option
+OPTIONS=""
+
+# option to pass when shorewall start is executed
+STARTOPTIONS=""
+
+# option to pass when shorewall restart is executed
+RESTARTOPTIONS=""
+
+# option to pass when shorewall reload is executed
+RELOADOPTIONS=""
+
+# option to pass when shorewall stop is executed
+STOPOPTIONS=""
diff --git a/shorewall-lite/uninstall.sh b/shorewall-lite/uninstall.sh
index 64102c4..98a6864 100755
--- a/shorewall-lite/uninstall.sh
+++ b/shorewall-lite/uninstall.sh
@@ -28,6 +28,7 @@
VERSION=5.0.3-Beta2
PRODUCT=shorewall-lite
+Product="Shorewall Lite"
usage() # $1 = exit status
{
@@ -80,6 +81,11 @@ remove_file() # $1 = file to restore
fi
}
+#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
+
finished=0
configure=1
@@ -205,14 +211,16 @@ fi
rm -f ${SBINDIR}/shorewall-lite
rm -rf ${CONFDIR}/shorewall-lite
-rm -rf ${VARDIR}/shorewall-lite
+rm -rf ${VARDIR}
rm -rf ${SHAREDIR}/shorewall-lite
rm -rf ${LIBEXECDIR}/shorewall-lite
rm -f ${CONFDIR}/logrotate.d/shorewall-lite
rm -f ${SYSCONFDIR}/shorewall-lite
+if [ -n "${MANDIR}" ]; then
rm -f ${MANDIR}/man5/shorewall-lite*
rm -f ${MANDIR}/man8/shorewall-lite*
+fi
echo "Shorewall Lite Uninstalled"
diff --git a/shorewall/install.sh b/shorewall/install.sh
index c42210f..cd10e7b 100755
--- a/shorewall/install.sh
+++ b/shorewall/install.sh
@@ -23,10 +23,9 @@
#
VERSION=5.0.3-Beta2
+PRODUCT=shorewall
+Product=Shorewall
-#
-# Change to the directory containing this script
-#
usage() # $1 = exit status
{
ME=$(basename $0)
@@ -101,16 +100,11 @@ require()
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
}
+#
+# Change to the directory containing this script
+#
cd "$(dirname $0)"
-if [ -f shorewall ]; then
- PRODUCT=shorewall
- Product=Shorewall
-else
- PRODUCT=shorewall6
- Product=Shorewall6
-fi
-
#
# Parse the run line
#
@@ -1184,7 +1178,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f
${DESTDIR}${SYSCONFDIR}/${PR
fi
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE}
${DESTDIR}${SYSCONFDIR}/$PRODUCT
- echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+ echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z
"${cygwin}${mac}" ]; then
diff --git a/shorewall/shorewallrc.openwrt b/shorewall/shorewallrc.openwrt
index 1f227eb..5f0809f 100644
--- a/shorewall/shorewallrc.openwrt
+++ b/shorewall/shorewallrc.openwrt
@@ -1,26 +1,23 @@
#
-# Created by Shorewall Core version 5.0.2-RC1 configure - Fri, Nov 06, 2015
10:02:03 AM
-#
-# Input: host=openwrt
+# Openwrt Shorewall 5.0 rc file
#
+BUILD= #Default is to detect the build system
HOST=openwrt
-PREFIX=/usr
-SHAREDIR=${PREFIX}/share
-LIBEXECDIR=${PREFIX}/share
-PERLLIBDIR=${PREFIX}/share/shorewall
-CONFDIR=/etc
-SBINDIR=/sbin
-MANDIR=${PREFIX}/man
-INITDIR=/etc/init.d
-INITSOURCE=init.openwrt.sh
-INITFILE=$PRODUCT
-AUXINITSOURCE=
-AUXINITFILE=
-SERVICEDIR=
-SERVICEFILE=
-SYSCONFFILE=default.openwrt
-SYSCONFDIR=${CONFDIR}/sysconfig
-SPARSE=
-ANNOTATED=
-VARLIB=/lib
-VARDIR=${VARLIB}/$PRODUCT
+PREFIX=/usr #Top-level directory for shared files,
libraries, etc.
+SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
+LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
+PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl
module directory
+CONFDIR=/etc #Directory where subsystem
configurations are installed
+SBINDIR=/sbin #Directory where system administration
programs are installed
+MANDIR= #Directory where manpages are installed.
+INITDIR=/etc/init.d #Directory where SysV init scripts are
installed.
+INITFILE=$PRODUCT #Name of the product's installed SysV
init script
+INITSOURCE=init.openwrt.sh #Name of the distributed file to be
installed as the SysV init script
+ANNOTATED= #If non-zero, annotated configuration
files are installed
+SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init
parameter files are installed
+SYSCONFFILE=sysconfig #Name of the distributed file to be
installed in $SYSCONFDIR
+SERVICEDIR= #Directory where .service files are
installed (systems running systemd only)
+SERVICEFILE= #Name of the file to install in
$SYSTEMD. Default is $PRODUCT.service
+SPARSE= #If non-empty, only install
$PRODUCT/$PRODUCT.conf in $CONFDIR
+VARLIB=/lib #Directory where product variable data is
stored.
+VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data
is stored.
diff --git a/shorewall/sysconfig b/shorewall/sysconfig
new file mode 100644
index 0000000..490b968
--- /dev/null
+++ b/shorewall/sysconfig
@@ -0,0 +1,16 @@
+# sysV init file script configuration(${SYSCONFDIR}/$PRODUCT)
+
+# startup option
+OPTIONS=""
+
+# option to pass when shorewall start is executed
+STARTOPTIONS=""
+
+# option to pass when shorewall restart is executed
+RESTARTOPTIONS=""
+
+# option to pass when shorewall reload is executed
+RELOADOPTIONS=""
+
+# option to pass when shorewall stop is executed
+STOPOPTIONS=""
diff --git a/shorewall/uninstall.sh b/shorewall/uninstall.sh
index af643d9..7d313ad 100755
--- a/shorewall/uninstall.sh
+++ b/shorewall/uninstall.sh
@@ -28,6 +28,7 @@
VERSION=5.0.3-Beta2
PRODUCT=shorewall
+Product=Shorewall
usage() # $1 = exit status
{
@@ -80,6 +81,11 @@ remove_file() # $1 = file to restore
fi
}
+#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
+
finished=0
configure=1
@@ -203,7 +209,7 @@ if [ -n "$SYSCONFDIR" ]; then
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
fi
-rm -rf ${VARDIR}/shorewall
+rm -rf ${VARDIR}
rm -rf ${PERLLIBDIR}/Shorewall/*
[ ${LIBEXECDIR} = ${SHAREDIR} ] || rm -rf ${LIBEXECDIR}/shorewall
rm -rf ${SHAREDIR}/shorewall/configfiles/
diff --git a/shorewall6-lite/default.openwrt b/shorewall6-lite/default.openwrt
deleted file mode 100644
index df4440b..0000000
--- a/shorewall6-lite/default.openwrt
+++ /dev/null
@@ -1,25 +0,0 @@
-# sysV init file script configuration(/etc/sysconfdir/shorewall-lite)
-
-# startup option(default "-vvv")
-OPTIONS=
-
-# change default start run level(if none empty; /etc/init.d/shorewall-lite
enable)
-START=50
-
-# change default stop run level(if none empty; /etc/init.d/shorewall-lite
enable)
-STOP=
-
-# option to pass when shorewall start is executed
-STARTOPTIONS=
-
-# option to pass when shorewall restart is executed
-RESTARTOPTIONS=
-
-# option to pass when shorewall reload is executed
-RELOADOPTIONS=
-
-# option to pass when shorewall stop is executed
-STOPOPTIONS=
-
-# option to pass when shorewall status is executed
-STATUSOPTIONS=
diff --git a/shorewall6-lite/init.openwrt.sh b/shorewall6-lite/init.openwrt.sh
index 29c4b17..4a190d6 100755
--- a/shorewall6-lite/init.openwrt.sh
+++ b/shorewall6-lite/init.openwrt.sh
@@ -32,38 +32,37 @@
# shorewall6-lite start Starts the firewall
# shorewall6-lite restart Restarts the firewall
# shorewall6-lite reload Reload the firewall
-# (same as restart)
# shorewall6-lite stop Stops the firewall
# shorewall6-lite status Displays firewall status
#
# description: Packet filtering firewall
-# openwrt stuph
+# Product name variable
+PRODUCT=shorewall6-lite
+
+# Openwrt related
# start and stop runlevel variable
-#START=21
-#STOP=91
-# variable to display what the status command do when
/etc/init.d/shorewall6-lite is invoke without argument
+START=50
+STOP=89
+# Displays the status command
EXTRA_COMMANDS="status"
-EXTRA_HELP="Displays shorewall status"
+EXTRA_HELP=" status Displays firewall status"
################################################################################
# Get startup options (override default)
################################################################################
-OPTIONS="-vvv"
+OPTIONS=
#
# The installer may alter this
#
. /usr/share/shorewall/shorewallrc
-if [ -f ${SYSCONFDIR}/shorewall6-lite ]; then
- . ${SYSCONFDIR}/shorewall6-lite
+if [ -f ${SYSCONFDIR}/$PRODUCT ]; then
+ . ${SYSCONFDIR}/$PRODUCT
fi
-START=${START:-21}
-STOP=${STOP:-91}
-
SHOREWALL_INIT_SCRIPT=1
################################################################################
@@ -73,26 +72,26 @@ SHOREWALL_INIT_SCRIPT=1
command="$action"
start() {
- exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${STARTOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $STARTOPTIONS
}
boot() {
-local command="start"
+local command=start
start
}
restart() {
- exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${RESTARTOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $RESTARTOPTIONS
}
reload() {
- exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${RELOADOPTION:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $RELOADOPTION
}
stop() {
- exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${STOPOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $STOPOPTIONS
}
status() {
- exec ${SBINDIR}/shorewall6-lite $OPTIONS $command ${STATUSOPTIONS:-$@}
+ exec ${SBINDIR}/$PRODUCT $OPTIONS $command $@
}
diff --git a/shorewall6-lite/install.sh b/shorewall6-lite/install.sh
index 3b44bf2..674b2a3 100755
--- a/shorewall6-lite/install.sh
+++ b/shorewall6-lite/install.sh
@@ -23,6 +23,8 @@
#
VERSION=5.0.3-Beta2
+PRODUCT=shorewall6-lite
+Product="Shorewall6 Lite"
usage() # $1 = exit status
{
@@ -114,14 +116,6 @@ require()
#
cd "$(dirname $0)"
-if [ -f shorewall-lite ]; then
- PRODUCT=shorewall-lite
- Product="Shorewall Lite"
-else
- PRODUCT=shorewall6-lite
- Product="Shorewall6 Lite"
-fi
-
#
# Parse the run line
#
@@ -495,7 +489,7 @@ done
# Install the Man Pages
#
-if [ -d manpages ]; then
+if [ -d manpages -a -n "${MANDIR}" ]; then
cd manpages
mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
@@ -550,7 +544,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f
${DESTDIR}${SYSCONFDIR}/${PR
fi
install_file ${SYSCONFFILE} ${DESTDIR}${SYSCONFDIR}/${PRODUCT} 0640
- echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+ echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ ${SHAREDIR} != /usr/share ]; then
diff --git a/shorewall6-lite/shorewallrc.openwrt
b/shorewall6-lite/shorewallrc.openwrt
index 1f227eb..5f0809f 100644
--- a/shorewall6-lite/shorewallrc.openwrt
+++ b/shorewall6-lite/shorewallrc.openwrt
@@ -1,26 +1,23 @@
#
-# Created by Shorewall Core version 5.0.2-RC1 configure - Fri, Nov 06, 2015
10:02:03 AM
-#
-# Input: host=openwrt
+# Openwrt Shorewall 5.0 rc file
#
+BUILD= #Default is to detect the build system
HOST=openwrt
-PREFIX=/usr
-SHAREDIR=${PREFIX}/share
-LIBEXECDIR=${PREFIX}/share
-PERLLIBDIR=${PREFIX}/share/shorewall
-CONFDIR=/etc
-SBINDIR=/sbin
-MANDIR=${PREFIX}/man
-INITDIR=/etc/init.d
-INITSOURCE=init.openwrt.sh
-INITFILE=$PRODUCT
-AUXINITSOURCE=
-AUXINITFILE=
-SERVICEDIR=
-SERVICEFILE=
-SYSCONFFILE=default.openwrt
-SYSCONFDIR=${CONFDIR}/sysconfig
-SPARSE=
-ANNOTATED=
-VARLIB=/lib
-VARDIR=${VARLIB}/$PRODUCT
+PREFIX=/usr #Top-level directory for shared files,
libraries, etc.
+SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
+LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
+PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl
module directory
+CONFDIR=/etc #Directory where subsystem
configurations are installed
+SBINDIR=/sbin #Directory where system administration
programs are installed
+MANDIR= #Directory where manpages are installed.
+INITDIR=/etc/init.d #Directory where SysV init scripts are
installed.
+INITFILE=$PRODUCT #Name of the product's installed SysV
init script
+INITSOURCE=init.openwrt.sh #Name of the distributed file to be
installed as the SysV init script
+ANNOTATED= #If non-zero, annotated configuration
files are installed
+SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init
parameter files are installed
+SYSCONFFILE=sysconfig #Name of the distributed file to be
installed in $SYSCONFDIR
+SERVICEDIR= #Directory where .service files are
installed (systems running systemd only)
+SERVICEFILE= #Name of the file to install in
$SYSTEMD. Default is $PRODUCT.service
+SPARSE= #If non-empty, only install
$PRODUCT/$PRODUCT.conf in $CONFDIR
+VARLIB=/lib #Directory where product variable data is
stored.
+VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data
is stored.
diff --git a/shorewall6-lite/sysconfig b/shorewall6-lite/sysconfig
new file mode 100644
index 0000000..490b968
--- /dev/null
+++ b/shorewall6-lite/sysconfig
@@ -0,0 +1,16 @@
+# sysV init file script configuration(${SYSCONFDIR}/$PRODUCT)
+
+# startup option
+OPTIONS=""
+
+# option to pass when shorewall start is executed
+STARTOPTIONS=""
+
+# option to pass when shorewall restart is executed
+RESTARTOPTIONS=""
+
+# option to pass when shorewall reload is executed
+RELOADOPTIONS=""
+
+# option to pass when shorewall stop is executed
+STOPOPTIONS=""
diff --git a/shorewall6-lite/uninstall.sh b/shorewall6-lite/uninstall.sh
index aa2c32f..8fff6ca 100755
--- a/shorewall6-lite/uninstall.sh
+++ b/shorewall6-lite/uninstall.sh
@@ -28,6 +28,7 @@
VERSION=5.0.3-Beta2
PRODUCT=shorewall6-lite
+Product="Shorewall6 Lite"
usage() # $1 = exit status
{
@@ -76,6 +77,11 @@ remove_file() # $1 = file to restore
fi
}
+#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
+
finished=0
configure=1
@@ -202,13 +208,15 @@ fi
rm -f ${SBINDIR}/shorewall6-lite
rm -rf ${CONFDIR}/shorewall6-lite
-rm -rf ${VARDIR}/shorewall6-lite
+rm -rf ${VARDIR}
rm -rf ${SHAREDIR}/shorewall6-lite
rm -rf ${LIBEXECDIR}/shorewall6-lite
rm -f ${CONFDIR}/logrotate.d/shorewall6-lite
rm -f ${SYSCONFDIR}/shorewall6-lite
+if [ -n "${MANDIR}" ]; then
rm -f ${MANDIR}/man5/shorewall6-lite*
rm -f ${MANDIR}/man8/shorewall6-lite*
+fi
echo "Shorewall6 Lite Uninstalled"
diff --git a/shorewall6/install.sh b/shorewall6/install.sh
index c42210f..523eddf 100755
--- a/shorewall6/install.sh
+++ b/shorewall6/install.sh
@@ -23,10 +23,9 @@
#
VERSION=5.0.3-Beta2
+PRODUCT=shorewall6
+Product=Shorewall6
-#
-# Change to the directory containing this script
-#
usage() # $1 = exit status
{
ME=$(basename $0)
@@ -101,16 +100,11 @@ require()
eval [ -n "\$$1" ] || fatal_error "Required option $1 not set"
}
+#
+# Change to the directory containing this script
+#
cd "$(dirname $0)"
-if [ -f shorewall ]; then
- PRODUCT=shorewall
- Product=Shorewall
-else
- PRODUCT=shorewall6
- Product=Shorewall6
-fi
-
#
# Parse the run line
#
@@ -1184,7 +1178,7 @@ if [ -n "$SYSCONFFILE" -a -f "$SYSCONFFILE" -a ! -f
${DESTDIR}${SYSCONFDIR}/${PR
fi
run_install $OWNERSHIP -m 0644 ${SYSCONFFILE}
${DESTDIR}${SYSCONFDIR}/$PRODUCT
- echo "$SYSCONFFILE installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
+ echo "$SYSCONFFILE file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}"
fi
if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z
"${cygwin}${mac}" ]; then
diff --git a/shorewall6/shorewallrc.openwrt b/shorewall6/shorewallrc.openwrt
index 1f227eb..5f0809f 100644
--- a/shorewall6/shorewallrc.openwrt
+++ b/shorewall6/shorewallrc.openwrt
@@ -1,26 +1,23 @@
#
-# Created by Shorewall Core version 5.0.2-RC1 configure - Fri, Nov 06, 2015
10:02:03 AM
-#
-# Input: host=openwrt
+# Openwrt Shorewall 5.0 rc file
#
+BUILD= #Default is to detect the build system
HOST=openwrt
-PREFIX=/usr
-SHAREDIR=${PREFIX}/share
-LIBEXECDIR=${PREFIX}/share
-PERLLIBDIR=${PREFIX}/share/shorewall
-CONFDIR=/etc
-SBINDIR=/sbin
-MANDIR=${PREFIX}/man
-INITDIR=/etc/init.d
-INITSOURCE=init.openwrt.sh
-INITFILE=$PRODUCT
-AUXINITSOURCE=
-AUXINITFILE=
-SERVICEDIR=
-SERVICEFILE=
-SYSCONFFILE=default.openwrt
-SYSCONFDIR=${CONFDIR}/sysconfig
-SPARSE=
-ANNOTATED=
-VARLIB=/lib
-VARDIR=${VARLIB}/$PRODUCT
+PREFIX=/usr #Top-level directory for shared files,
libraries, etc.
+SHAREDIR=${PREFIX}/share #Directory for arch-neutral files.
+LIBEXECDIR=${PREFIX}/share #Directory for executable scripts.
+PERLLIBDIR=${PREFIX}/share/shorewall #Directory to install Shorewall Perl
module directory
+CONFDIR=/etc #Directory where subsystem
configurations are installed
+SBINDIR=/sbin #Directory where system administration
programs are installed
+MANDIR= #Directory where manpages are installed.
+INITDIR=/etc/init.d #Directory where SysV init scripts are
installed.
+INITFILE=$PRODUCT #Name of the product's installed SysV
init script
+INITSOURCE=init.openwrt.sh #Name of the distributed file to be
installed as the SysV init script
+ANNOTATED= #If non-zero, annotated configuration
files are installed
+SYSCONFDIR=${CONFDIR}/sysconfig #Directory where SysV init
parameter files are installed
+SYSCONFFILE=sysconfig #Name of the distributed file to be
installed in $SYSCONFDIR
+SERVICEDIR= #Directory where .service files are
installed (systems running systemd only)
+SERVICEFILE= #Name of the file to install in
$SYSTEMD. Default is $PRODUCT.service
+SPARSE= #If non-empty, only install
$PRODUCT/$PRODUCT.conf in $CONFDIR
+VARLIB=/lib #Directory where product variable data is
stored.
+VARDIR=${VARLIB}/$PRODUCT #Directory where product variable data
is stored.
diff --git a/shorewall6/sysconfig b/shorewall6/sysconfig
new file mode 100644
index 0000000..490b968
--- /dev/null
+++ b/shorewall6/sysconfig
@@ -0,0 +1,16 @@
+# sysV init file script configuration(${SYSCONFDIR}/$PRODUCT)
+
+# startup option
+OPTIONS=""
+
+# option to pass when shorewall start is executed
+STARTOPTIONS=""
+
+# option to pass when shorewall restart is executed
+RESTARTOPTIONS=""
+
+# option to pass when shorewall reload is executed
+RELOADOPTIONS=""
+
+# option to pass when shorewall stop is executed
+STOPOPTIONS=""
diff --git a/shorewall6/uninstall.sh b/shorewall6/uninstall.sh
index f3d481c..68485bc 100755
--- a/shorewall6/uninstall.sh
+++ b/shorewall6/uninstall.sh
@@ -28,6 +28,7 @@
VERSION=5.0.3-Beta2
PRODUCT=shorewall6
+Product=Shorewall6
usage() # $1 = exit status
{
@@ -76,6 +77,11 @@ remove_file() # $1 = file to restore
fi
}
+#
+# Change to the directory containing this script
+#
+cd "$(dirname $0)"
+
finished=0
configure=1
@@ -192,7 +198,6 @@ if [ -n "$SERVICEDIR" ]; then
fi
rm -rf ${SHAREDIR}/shorewall6/version
-rm -rf ${CONFDIR}/shorewall6
if [ -n "$SYSCONFDIR" ]; then
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
@@ -200,7 +205,7 @@ fi
rm -f ${SBINDIR}/shorewall6
rm -rf ${CONFDIR}/shorewall6
-rm -rf ${VARDIR}/shorewall6
+rm -rf ${VARDIR}
rm -rf ${LIBEXECDIR}/shorewall6
rm -rf ${SHAREDIR}/shorewall6
@@ -214,7 +219,6 @@ for f in ${MANDIR}/man5/shorewall6*
${SHAREDIR}/man/man8/shorewall6*; do
done
rm -f ${CONFDIR}/logrotate.d/shorewall6
-[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/shorewall6.service
echo "Shorewall6 Uninstalled"
------------------------------------------------------------------------------
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users