Unify the CLI

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-11-21 10:00:55 -08:00
parent dae060bbb4
commit 875c352473
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10
29 changed files with 123 additions and 6100 deletions

View File

@ -365,6 +365,12 @@ fi
# Note: ${VARDIR} is created at run-time since it has always been # Note: ${VARDIR} is created at run-time since it has always been
# a relocatable directory on a per-product basis # a relocatable directory on a per-product basis
# #
# Install the CLI
#
install_file shorewall ${DESTDIR}${SBINDIR}/shorewall 0755
[ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall
echo "Shorewall CLI program installed in ${DESTDIR}${SBINDIR}/$PRODUCT"
#
# Install wait4ifup # Install wait4ifup
# #
install_file wait4ifup ${DESTDIR}${LIBEXECDIR}/shorewall/wait4ifup 0755 install_file wait4ifup ${DESTDIR}${LIBEXECDIR}/shorewall/wait4ifup 0755

View File

@ -35,26 +35,26 @@ fatal_error() # $@ = Message
exit 2 exit 2
} }
setup_product_environment() { setup_product_environment() { # $1 -- if non-empty, source shorewallrc
g_basedir=${SHAREDIR}/shorewall g_basedir=${SHAREDIR}/shorewall
g_sharedir="$SHAREDIR"/$PRODUCT g_sharedir="$SHAREDIR"/$PRODUCT
g_confdir="$CONFDIR"/$PRODUCT g_confdir="$CONFDIR"/$PRODUCT
g_program=$PRODUCT case $PRODUCT in
case $g_program in
shorewall) shorewall)
g_product="Shorewall" g_product="Shorewall"
g_family=4 g_family=4
g_tool=iptables g_tool=iptables
g_lite= g_lite=
g_options=-l
;; ;;
shorewall6) shorewall6)
g_product="Shorewall6" g_product="Shorewall6"
g_family=6 g_family=6
g_tool=ip6tables g_tool=ip6tables
g_lite= g_lite=
g_options=-6l
;; ;;
shorewall-lite) shorewall-lite)
g_product="Shorewall Lite" g_product="Shorewall Lite"
@ -74,10 +74,14 @@ setup_product_environment() {
esac esac
[ -f ${SHAREDIR}/${PRODUCT}/version ] || fatal_error "$g_product does not appear to be installed on this system" [ -f ${SHAREDIR}/${PRODUCT}/version ] || fatal_error "$g_product does not appear to be installed on this system"
#
# We need to do this again, now that we have the correct product
#
[ -n "$1" ] && . ${g_basedir}/shorewallrc
if [ -z "${VARLIB}" ]; then if [ -z "${VARLIB}" ]; then
VARLIB=${VARDIR} VARLIB=${VARDIR}
VARDIR=${VARLIB}/$g_program VARDIR=${VARLIB}/${PRODUCT}
elif [ -z "${VARDIR}" ]; then elif [ -z "${VARDIR}" ]; then
VARDIR="${VARLIB}/${PRODUCT}" VARDIR="${VARLIB}/${PRODUCT}"
fi fi

View File

@ -1357,14 +1357,14 @@ show_command() {
echo "LIBEXEC=${LIBEXECDIR}" echo "LIBEXEC=${LIBEXECDIR}"
echo "SBINDIR=${SBINDIR}" echo "SBINDIR=${SBINDIR}"
echo "CONFDIR=${CONFDIR}" echo "CONFDIR=${CONFDIR}"
[ -n "$g_lite" ] && [ ${VARDIR} != /var/lib/$g_program ] && echo "LITEDIR=${VARDIR}" [ -n "$g_lite" ] && [ ${VARDIR} != /var/lib/$PRODUCT ] && echo "LITEDIR=${VARDIR}"
else else
echo "Default CONFIG_PATH is $CONFIG_PATH" echo "Default CONFIG_PATH is $CONFIG_PATH"
echo "Default VARDIR is /var/lib/$g_program" echo "Default VARDIR is /var/lib/$PRODUCT"
echo "LIBEXEC is ${LIBEXECDIR}" echo "LIBEXEC is ${LIBEXECDIR}"
echo "SBINDIR is ${SBINDIR}" echo "SBINDIR is ${SBINDIR}"
echo "CONFDIR is ${CONFDIR}" echo "CONFDIR is ${CONFDIR}"
[ -n "$g_lite" ] && [ ${VARDIR} != /var/lib/$g_program ] && echo "LITEDIR is ${VARDIR}" [ -n "$g_lite" ] && [ ${VARDIR} != /var/lib/$PRODUCT ] && echo "LITEDIR is ${VARDIR}"
fi fi
;; ;;
chain) chain)
@ -1428,7 +1428,7 @@ show_command() {
fi fi
;; ;;
*) *)
case "$g_program" in case "$PRODUCT" in
*-lite) *-lite)
;; ;;
*) *)
@ -3866,7 +3866,7 @@ get_config() {
ensure_config_path ensure_config_path
config=$(find_file ${g_program}.conf) config=$(find_file ${PRODUCT}.conf)
if [ -f $config ]; then if [ -f $config ]; then
if [ -r $config ]; then if [ -r $config ]; then
@ -4362,6 +4362,7 @@ shorewall_cli() {
g_nopager= g_nopager=
g_blacklistipset= g_blacklistipset=
g_disconnect= g_disconnect=
g_options=
VERBOSE= VERBOSE=
VERBOSITY=1 VERBOSITY=1
@ -4503,7 +4504,7 @@ shorewall_cli() {
usage 1 usage 1
fi fi
setup_product_environment setup_product_environment 1
[ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std [ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std
@ -4512,7 +4513,7 @@ shorewall_cli() {
[ -f ${g_confdir}/vardir ] && . ${g_confdir}/vardir [ -f ${g_confdir}/vardir ] && . ${g_confdir}/vardir
[ -n "${VARDIR:=/var/lib/$g_program}" ] [ -n "${VARDIR:=/var/lib/$PRODUCT}" ]
g_firewall=${VARDIR}/firewall g_firewall=${VARDIR}/firewall

View File

@ -13,7 +13,7 @@
. /lib/lsb/init-functions . /lib/lsb/init-functions
SRWL=/sbin/shorewall-lite SRWL='/sbin/shorewall -l'
SRWL_OPTS="-tvv" SRWL_OPTS="-tvv"
test -n ${INITLOG:=/var/log/shorewall-lite-init.log} test -n ${INITLOG:=/var/log/shorewall-lite-init.log}

View File

@ -25,7 +25,7 @@
# #
. /usr/share/shorewall/shorewallrc . /usr/share/shorewall/shorewallrc
prog="shorewall-lite" prog="shorewall -l"
shorewall="${SBINDIR}/$prog" shorewall="${SBINDIR}/$prog"
logger="logger -i -t $prog" logger="logger -i -t $prog"
lockfile="/var/lock/subsys/$prog" lockfile="/var/lock/subsys/$prog"

View File

@ -69,7 +69,7 @@ SHOREWALL_INIT_SCRIPT=1
command="$action" command="$action"
start() { start() {
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $STARTOPTIONS exec ${SBINDIR}/shorewall -l $OPTIONS $command $STARTOPTIONS
} }
boot() { boot() {
@ -78,17 +78,17 @@ boot() {
} }
restart() { restart() {
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $RESTARTOPTIONS exec ${SBINDIR}/shorewall -l $OPTIONS $command $RESTARTOPTIONS
} }
reload() { reload() {
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $RELOADOPTION exec ${SBINDIR}/shorewall -l $OPTIONS $command $RELOADOPTION
} }
stop() { stop() {
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $STOPOPTIONS exec ${SBINDIR}/shorewall -l $OPTIONS $command $STOPOPTIONS
} }
status() { status() {
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $@ exec ${SBINDIR}/shorewall -l $OPTIONS $command $@
} }

View File

@ -114,7 +114,7 @@ require()
# #
cd "$(dirname $0)" cd "$(dirname $0)"
if [ -f shorewall-lite ]; then if [ -f shorewall-lite.service ]; then
PRODUCT=shorewall-lite PRODUCT=shorewall-lite
Product="Shorewall Lite" Product="Shorewall Lite"
else else
@ -331,7 +331,6 @@ if [ -n "$DESTDIR" ]; then
OWNERSHIP="" OWNERSHIP=""
fi fi
make_directory ${DESTDIR}${SBINDIR} 755
make_directory ${DESTDIR}${INITDIR} 755 make_directory ${DESTDIR}${INITDIR} 755
else else
@ -362,9 +361,9 @@ else
fi fi
# #
# Check for ${SBINDIR}/$PRODUCT # Check for ${SHAREDIR}/$PRODUCT/version
# #
if [ -f ${DESTDIR}${SBINDIR}/$PRODUCT ]; then if [ -f ${DESTDIR}${SHAREDIR}/$PRODUCT/version ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
@ -372,11 +371,8 @@ fi
delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules
install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0544
[ -n "${INITFILE}" ] && make_directory ${DESTDIR}${INITDIR} 755 [ -n "${INITFILE}" ] && make_directory ${DESTDIR}${INITDIR} 755
echo "$Product control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT"
# #
# Create ${CONFDIR}/$PRODUCT, /usr/share/$PRODUCT and /var/lib/$PRODUCT if needed # Create ${CONFDIR}/$PRODUCT, /usr/share/$PRODUCT and /var/lib/$PRODUCT if needed
# #
@ -498,7 +494,7 @@ done
if [ -d manpages -a -n "$MANDIR" ]; then if [ -d manpages -a -n "$MANDIR" ]; then
cd manpages cd manpages
mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/ mkdir -p ${DESTDIR}${MANDIR}/man5/
for f in *.5; do for f in *.5; do
gzip -c $f > $f.gz gzip -c $f > $f.gz
@ -506,12 +502,6 @@ if [ -d manpages -a -n "$MANDIR" ]; then
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
done done
for f in *.8; do
gzip -c $f > $f.gz
install_file $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz 644
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
done
cd .. cd ..
echo "Man Pages Installed" echo "Man Pages Installed"
@ -539,6 +529,7 @@ fi
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.common delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.common
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.cli delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.cli
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/wait4ifup delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/wait4ifup
delete_file ${DESTDIR}${SBINDIR}/$PRODUCT
# #
# Note -- not all packages will have the SYSCONFFILE so we need to check for its existance here # Note -- not all packages will have the SYSCONFFILE so we need to check for its existance here
@ -555,7 +546,6 @@ fi
if [ ${SHAREDIR} != /usr/share ]; then if [ ${SHAREDIR} != /usr/share ]; then
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.base eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SHAREDIR}/${PRODUCT}/lib.base
eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/$PRODUCT
fi fi
if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then if [ $configure -eq 1 -a -z "$DESTDIR" -a -n "$first_install" -a -z "${cygwin}${mac}" ]; then

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
#!/bin/sh
#
# Shorewall Lite Packet Filtering Firewall Control Program - V4.5
#
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2014 -
# Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://www.shorewall.net
#
# 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/>.
#
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
#
################################################################################################
PRODUCT=shorewall-lite
#
# This is modified by the installer when ${SHAREDIR} != /usr/share
#
. /usr/share/shorewall/shorewallrc
g_basedir=${SHAREDIR}/shorewall
. ${g_basedir}/lib.cli
shorewall_cli $@

View File

@ -103,7 +103,7 @@ require()
cd "$(dirname $0)" cd "$(dirname $0)"
if [ -f shorewall ]; then if [ -f shorewall.service ]; then
PRODUCT=shorewall PRODUCT=shorewall
Product=Shorewall Product=Shorewall
else else
@ -381,9 +381,9 @@ fi
echo "Installing $Product Version $VERSION" echo "Installing $Product Version $VERSION"
# #
# Check for /sbin/$PRODUCT # Check for /usr/share/$PRODUCT/version
# #
if [ -f ${DESTDIR}${SBINDIR}/$PRODUCT ]; then if [ -f ${DESTDIR}${SHAREDIR}/$PRODUCT/version ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"
@ -394,10 +394,6 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f ${SHAREDIR}/$PRODUCT/coreve
exit 1 exit 1
fi fi
install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0755
[ $SHAREDIR = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/${PRODUCT}
echo "$PRODUCT control program installed in ${DESTDIR}${SBINDIR}/$PRODUCT"
# #
# Install the Firewall Script # Install the Firewall Script
# #
@ -468,6 +464,7 @@ if [ -z "$first_install" ]; then
delete_file ${DESTDIR}/usr/share/shorewall6/lib.cli delete_file ${DESTDIR}/usr/share/shorewall6/lib.cli
delete_file ${DESTDIR}/usr/share/shorewall6/lib.common delete_file ${DESTDIR}/usr/share/shorewall6/lib.common
delete_file ${DESTDIR}/usr/share/shorewall6/wait4ifup delete_file ${DESTDIR}/usr/share/shorewall6/wait4ifup
delete_file ${DESTDIR}/${SBINDIR}/shorewall6
fi fi
delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.header6 delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.header6
@ -1179,7 +1176,7 @@ if [ -n "$MANDIR" ]; then
cd manpages cd manpages
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/ [ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/
for f in *.5; do for f in *.5; do
gzip -9c $f > $f.gz gzip -9c $f > $f.gz
@ -1187,11 +1184,15 @@ for f in *.5; do
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man5/$f.gz"
done done
for f in *.8; do if [ $PRODUCT = shorewall ]; then
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/
for f in *.8; do
gzip -9c $f > $f.gz gzip -9c $f > $f.gz
run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz run_install $INSTALLD -m 0644 $f.gz ${DESTDIR}${MANDIR}/man8/$f.gz
echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz" echo "Man page $f.gz installed to ${DESTDIR}${MANDIR}/man8/$f.gz"
done done
fi
cd .. cd ..

View File

@ -48,10 +48,10 @@ get_config() {
fi fi
if [ "$(id -u)" -eq 0 ]; then if [ "$(id -u)" -eq 0 ]; then
config=$(find_file $g_program.conf) config=$(find_file ${PRODUCT}.conf)
else else
[ -n "$g_shorewalldir" ] || fatal_error "Ordinary users may not $COMMAND the $CONFDIR/$g_program configuration" [ -n "$g_shorewalldir" ] || fatal_error "Ordinary users may not $COMMAND the $CONFDIR/$PRODUCT configuration"
config="$g_shorewalldir/$g_program.conf" config="$g_shorewalldir/$PRODUCT.conf"
fi fi
if [ -f $config ]; then if [ -f $config ]; then
@ -155,7 +155,7 @@ get_config() {
if [ "$2" = Yes ]; then if [ "$2" = Yes ]; then
case $STARTUP_ENABLED in case $STARTUP_ENABLED in
No|no|NO) No|no|NO)
not_configured_error "$g_product startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${g_confdir}/${g_program}.conf" not_configured_error "$g_product startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${g_confdir}/${PRODUCT}.conf"
;; ;;
Yes|yes|YES) Yes|yes|YES)
;; ;;
@ -397,8 +397,8 @@ compiler() {
pc=${LIBEXECDIR}/shorewall/compiler.pl pc=${LIBEXECDIR}/shorewall/compiler.pl
if [ $(id -u) -ne 0 ]; then if [ $(id -u) -ne 0 ]; then
if [ -z "$g_shorewalldir" -o "$g_shorewalldir" = $CONFDIR/$g_program ]; then if [ -z "$g_shorewalldir" -o "$g_shorewalldir" = $CONFDIR/$PRODUCT ]; then
startup_error "Ordinary users may not $COMMAND the $CONFDIR/$g_program configuration" startup_error "Ordinary users may not $COMMAND the $CONFDIR/$PRODUCT configuration"
fi fi
fi fi
# #
@ -1419,6 +1419,7 @@ remote_reload_command() # $* = original arguments less the command.
sharedir=${SHAREDIR} sharedir=${SHAREDIR}
local litedir local litedir
local exitstatus local exitstatus
local program
while [ $finished -eq 0 -a $# -gt 0 ]; do while [ $finished -eq 0 -a $# -gt 0 ]; do
option=$1 option=$1
@ -1495,12 +1496,17 @@ remote_reload_command() # $* = original arguments less the command.
sbindir="$SBINDIR" sbindir="$SBINDIR"
confdir="$CONFDIR" confdir="$CONFDIR"
libexec="$LIBEXECDIR" libexec="$LIBEXECDIR"
litedir="${VARDIR}-lite"
. $sharedir/shorewall/shorewallrc . $sharedir/shorewall/shorewallrc
else else
error_message " WARNING: $g_shorewalldir/shorewallrc does not exist; using settings from $SHAREDIR/shorewall" >&2 error_message " WARNING: $g_shorewalldir/shorewallrc does not exist; using settings from $g_basedir/shorewalrc" >&2
sbindir="$SBINDIR"
confdir="$CONFDIR"
libexec="$LIBEXECDIR"
litedir="${VARDIR}-lite"
fi fi
if [ -f $g_shorewalldir/${g_program}.conf ]; then if [ -f $g_shorewalldir/${PRODUCT}.conf ]; then
if [ -f $g_shorewalldir/params ]; then if [ -f $g_shorewalldir/params ]; then
. $g_shorewalldir/params . $g_shorewalldir/params
fi fi
@ -1516,7 +1522,7 @@ remote_reload_command() # $* = original arguments less the command.
[ -n "$system" ] || fatal_error "No system name given and the FIREWALL option is not set" [ -n "$system" ] || fatal_error "No system name given and the FIREWALL option is not set"
fi fi
else else
fatal_error "$g_shorewalldir/$g_program.conf does not exist" fatal_error "$g_shorewalldir/$PRODUCT.conf does not exist"
fi fi
if [ -z "$getcaps" ]; then if [ -z "$getcaps" ]; then
@ -1540,13 +1546,23 @@ remote_reload_command() # $* = original arguments less the command.
file=$(resolve_file $g_shorewalldir/firewall) file=$(resolve_file $g_shorewalldir/firewall)
g_export=Yes g_export=Yes
#
# Determine the remote CLI program
#
temp=$(rsh_command /bin/ls $sbindir/${PRODUCT}-lite 2> /dev/null)
temp=$(rsh_command ${g_program}-lite show config 2> /dev/null | grep ^LITEDIR | sed 's/LITEDIR is //') if [ -n "$temp" ]; then
program=$sbindir/${PRODUCT}-lite
else
program="$sbindir/shorewall $g_options"
fi
#
# Handle nonstandard remote VARDIR
#
temp=$(rsh_command $program show config 2> /dev/null | grep ^LITEDIR | sed 's/LITEDIR is //')
[ -n "$temp" ] && litedir="$temp" [ -n "$temp" ] && litedir="$temp"
[ -n "$litedir" ] || litedir=${VARLIB}/${g_program}-lite
g_file="$g_shorewalldir/firewall" g_file="$g_shorewalldir/firewall"
exitstatus=0 exitstatus=0
@ -1557,30 +1573,29 @@ remote_reload_command() # $* = original arguments less the command.
save=$(find_file save); save=$(find_file save);
if [ -f $save ]; then if [ -f $save ]; then
progress_message3 "Copying $save to ${system}:${confdir}/${g_program}-lite/" progress_message3 "Copying $save to ${system}:${confdir}/${PRODUCT}-lite/"
rcp_command $save ${confdir}/shorewall-lite/ rcp_command $save ${confdir}/$PRODUCT/
exitstatus=$? exitstatus=$?
fi fi
if [ $exitstatus -eq 0 ]; then if [ $exitstatus -eq 0 ]; then
progress_message3 "Copy complete" progress_message3 "Copy complete"
if [ $COMMAND = remote-reload ]; then if [ $COMMAND = remote-reload ]; then
if rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp reload"; then if rsh_command "$program $g_debugging $verbose $timestamp reload"; then
progress_message3 "System $system reloaded" progress_message3 "System $system reloaded"
else else
exitstatus=$? exitstatus=$?
savit= savit=
fi fi
elif [ $COMMAND = remote-restart ]; then elif [ $COMMAND = remote-restart ]; then
if rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp restart"; then if rsh_command "$program $g_debugging $verbose $timestamp restart"; then
progress_message3 "System $system restarted" progress_message3 "System $system restarted"
else else
exitstatus=$? exitstatus=$?
saveit= saveit=
fi fi
elif rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp start"; then elif rsh_command "$program $g_debugging $verbose $timestamp start"; then
progress_message3 "System $system started" progress_message3 "System $system started"
else else
exitstatus=$? exitstatus=$?
@ -1588,7 +1603,7 @@ remote_reload_command() # $* = original arguments less the command.
fi fi
if [ -n "$saveit" ]; then if [ -n "$saveit" ]; then
if rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp save"; then if rsh_command "$program $g_debugging $verbose $timestamp save"; then
progress_message3 "Configuration on system $system saved" progress_message3 "Configuration on system $system saved"
else else
exitstatus=$? exitstatus=$?
@ -1653,7 +1668,7 @@ export_command() # $* = original arguments less the command.
target=$2 target=$2
;; ;;
*) *)
fatal_error "Invalid command syntax (\"man $g_program\" for help)" fatal_error "Invalid command syntax (\"man shorewall\" for help)"
;; ;;
esac esac

View File

@ -13,7 +13,7 @@
. /lib/lsb/init-functions . /lib/lsb/init-functions
SRWL=/sbin/shorewall6-lite SRWL='/sbin/shorewall6-lite -6'
SRWL_OPTS="-tvv" SRWL_OPTS="-tvv"
test -n ${INITLOG:=/var/log/shorewall6-lite-init.log} test -n ${INITLOG:=/var/log/shorewall6-lite-init.log}

View File

@ -25,7 +25,7 @@
# #
. /usr/share/shorewall/shorewallrc . /usr/share/shorewall/shorewallrc
prog="shorewall6-lite" prog="shorewall -6l"
shorewall="${SBINDIR}/$prog" shorewall="${SBINDIR}/$prog"
logger="logger -i -t $prog" logger="logger -i -t $prog"
lockfile="/var/lock/subsys/$prog" lockfile="/var/lock/subsys/$prog"

View File

@ -79,17 +79,17 @@ boot() {
} }
restart() { restart() {
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $RESTARTOPTIONS exec ${SBINDIR}/shorewall -6l $OPTIONS $command $RESTARTOPTIONS
} }
reload() { reload() {
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $RELOADOPTION exec ${SBINDIR}/shorewall -6l $OPTIONS $command $RELOADOPTION
} }
stop() { stop() {
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $STOPOPTIONS exec ${SBINDIR}/shorewall -6l $OPTIONS $command $STOPOPTIONS
} }
status() { status() {
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@ exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
} }

View File

@ -76,13 +76,13 @@ command="$1"
case "$command" in case "$command" in
start) start)
exec ${SBINDIR}/shorewall6-lite $OPTIONS start $STARTOPTIONS exec ${SBINDIR}/shorewall -6l $OPTIONS start $STARTOPTIONS
;; ;;
restart|reload) restart|reload)
exec ${SBINDIR}/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS exec ${SBINDIR}/shorewall -6l $OPTIONS restart $RESTARTOPTIONS
;; ;;
status|stop) status|stop)
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@ exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
;; ;;
*) *)
usage usage

View File

@ -73,13 +73,13 @@ command="$1"
case "$command" in case "$command" in
start) start)
exec ${SBINDIR}/shorewall6-lite $OPTIONS start $STARTOPTIONS exec ${SBINDIR}/shorewall -6l $OPTIONS start $STARTOPTIONS
;; ;;
restart|reload) restart|reload)
exec ${SBINDIR}/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS exec ${SBINDIR}/shorewall -6l $OPTIONS restart $RESTARTOPTIONS
;; ;;
status|stop) status|stop)
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@ exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
;; ;;
*) *)
usage usage

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
#!/bin/sh
#
# Shorewall6 Lite Packet Filtering Firewall Control Program - V4.5
#
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011, 2012-2014
# Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://www.shorewall.net
#
# 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/>.
#
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
#
################################################################################################
PRODUCT=shorewall6-lite
#
# This is modified by the installer when ${SHAREDIR} != /usr/share
#
. /usr/share/shorewall/shorewallrc
g_basedir=${SHAREDIR}/shorewall
. ${g_basedir}/lib.cli
shorewall_cli $@

View File

@ -14,8 +14,9 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6-lite EnvironmentFile=-/etc/sysconfig/shorewall6-lite
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS ExecStart=/sbin/shorewal -6l $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6-lite $OPTIONS stop ExecStop=/sbin/shorewall -6l $OPTIONS stop
ExecReload=/sbin/shorewall -6l $OPTIONS reload $RELOADOPTIONS
[Install] [Install]
WantedBy=basic.target WantedBy=basic.target

View File

@ -12,7 +12,7 @@
. /lib/lsb/init-functions . /lib/lsb/init-functions
SRWL=/sbin/shorewall6 SRWL='/sbin/shorewall -6'
SRWL_OPTS="-tvv" SRWL_OPTS="-tvv"
WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
test -n ${INITLOG:=/var/log/shorewall6-init.log} test -n ${INITLOG:=/var/log/shorewall6-init.log}

View File

@ -25,7 +25,7 @@
# #
. /usr/share/shorewall/shorewallrc . /usr/share/shorewall/shorewallrc
prog="shorewall6" prog="shorewall -6"
shorewall="${SBINDIR}/$prog" shorewall="${SBINDIR}/$prog"
logger="logger -i -t $prog" logger="logger -i -t $prog"
lockfile="/var/lock/subsys/$prog" lockfile="/var/lock/subsys/$prog"

View File

@ -77,13 +77,13 @@ command="$1"
case "$command" in case "$command" in
start) start)
exec ${SBINDIR}/shorewall6 $OPTIONS start $STARTOPTIONS exec ${SBINDIR}/shorewall -6 $OPTIONS start $STARTOPTIONS
;; ;;
restart|reload) restart|reload)
exec ${SBINDIR}/shorewall6 $OPTIONS restart $RESTARTOPTIONS exec ${SBINDIR}/shorewall -6 $OPTIONS restart $RESTARTOPTIONS
;; ;;
status|stop) status|stop)
exec ${SBINDIR}/shorewall6 $OPTIONS $command $@ exec ${SBINDIR}/shorewall -6 $OPTIONS $command $@
;; ;;
*) *)
usage usage

View File

@ -20,21 +20,21 @@ fi
start() { start() {
echo "Starting IPv6 shorewall rules..." echo "Starting IPv6 shorewall rules..."
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS exec /sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
} }
stop() { stop() {
echo "Stopping IPv6 shorewall rules..." echo "Stopping IPv6 shorewall rules..."
exec /sbin/shorewall6 stop exec /sbin/shorewall -6 stop
} }
restart() { restart() {
echo "Restarting IPv6 shorewall rules..." echo "Restarting IPv6 shorewall rules..."
exec /sbin/shorewall6 restart $RESTARTOPTIONS exec /sbin/shorewall -6 restart $RESTARTOPTIONS
} }
status() { status() {
exec /sbin/shorewall6 status exec /sbin/shorewall -6 status
} }
case "$1" in case "$1" in

View File

@ -75,13 +75,16 @@ command="$1"
case "$command" in case "$command" in
start) start)
exec ${SBINDIR}/shorewall6 $OPTIONS start $STARTOPTIONS exec ${SBINDIR}/shorewall -6 $OPTIONS start $STARTOPTIONS
;; ;;
restart|reload) restart)
exec ${SBINDIR}/shorewall6 $OPTIONS restart $RESTARTOPTIONS exec ${SBINDIR}/shorewall -6 $OPTIONS restart $RESTARTOPTIONS
;;
reload)
exec ${SBINDIR}/shorewall -6 $OPTIONS reload $RESTARTOPTIONS
;; ;;
status|stop) status|stop)
exec ${SBINDIR}/shorewall6 $OPTIONS $command $@ exec ${SBINDIR}/shorewall -6 $OPTIONS $command $@
;; ;;
*) *)
usage usage

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
#!/bin/sh
#
# Shorewall6 Packet Filtering Firewall Control Program - V4.5
#
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2014 -
# Tom Eastep (teastep@shorewall.net)
#
# Shorewall documentation is available at http://www.shorewall.net
#
# 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/>.
#
# For a list of supported commands, type 'shorewall help' or 'shorewall6 help'
#
################################################################################################
PRODUCT=shorewall6
#
# This is modified by the installer when ${SHAREDIR} != /usr/share
#
. /usr/share/shorewall/shorewallrc
g_basedir=${SHAREDIR}/shorewall
. ${g_basedir}/lib.cli
shorewall_cli $@

View File

@ -14,9 +14,9 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/sysconfig/shorewall6 EnvironmentFile=-/etc/sysconfig/shorewall6
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS ExecStart=/sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6 $OPTIONS stop ExecStop=/sbin/shorewall -6 $OPTIONS stop
ExecReload=/sbin/shorewall6 $OPTIONS reload $RELOADOPTIONS ExecReload=/sbin/shorewall -6 $OPTIONS reload $RELOADOPTIONS
[Install] [Install]
WantedBy=basic.target WantedBy=basic.target

View File

@ -15,9 +15,9 @@ Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
EnvironmentFile=-/etc/default/shorewall6 EnvironmentFile=-/etc/default/shorewall6
StandardOutput=syslog StandardOutput=syslog
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS ExecStart=/sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
ExecStop=/sbin/shorewall6 $OPTIONS stop ExecStop=/sbin/shorewall -6 $OPTIONS stop
ExecReload=/sbin/shorewall6 $OPTIONS reload $RELOADOPTIONS ExecReload=/sbin/shorewall -6 $OPTIONS reload $RELOADOPTIONS
[Install] [Install]
WantedBy=basic.target WantedBy=basic.target