mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-21 23:23:13 +01:00
Unify the CLI
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
dae060bbb4
commit
875c352473
@ -365,6 +365,12 @@ fi
|
||||
# Note: ${VARDIR} is created at run-time since it has always been
|
||||
# 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_file wait4ifup ${DESTDIR}${LIBEXECDIR}/shorewall/wait4ifup 0755
|
||||
|
@ -35,26 +35,26 @@ fatal_error() # $@ = Message
|
||||
exit 2
|
||||
}
|
||||
|
||||
setup_product_environment() {
|
||||
setup_product_environment() { # $1 -- if non-empty, source shorewallrc
|
||||
g_basedir=${SHAREDIR}/shorewall
|
||||
|
||||
g_sharedir="$SHAREDIR"/$PRODUCT
|
||||
g_confdir="$CONFDIR"/$PRODUCT
|
||||
|
||||
g_program=$PRODUCT
|
||||
|
||||
case $g_program in
|
||||
case $PRODUCT in
|
||||
shorewall)
|
||||
g_product="Shorewall"
|
||||
g_family=4
|
||||
g_tool=iptables
|
||||
g_lite=
|
||||
g_options=-l
|
||||
;;
|
||||
shorewall6)
|
||||
g_product="Shorewall6"
|
||||
g_family=6
|
||||
g_tool=ip6tables
|
||||
g_lite=
|
||||
g_options=-6l
|
||||
;;
|
||||
shorewall-lite)
|
||||
g_product="Shorewall Lite"
|
||||
@ -74,10 +74,14 @@ setup_product_environment() {
|
||||
esac
|
||||
|
||||
[ -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
|
||||
VARLIB=${VARDIR}
|
||||
VARDIR=${VARLIB}/$g_program
|
||||
VARDIR=${VARLIB}/${PRODUCT}
|
||||
elif [ -z "${VARDIR}" ]; then
|
||||
VARDIR="${VARLIB}/${PRODUCT}"
|
||||
fi
|
||||
|
@ -1357,14 +1357,14 @@ show_command() {
|
||||
echo "LIBEXEC=${LIBEXECDIR}"
|
||||
echo "SBINDIR=${SBINDIR}"
|
||||
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
|
||||
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 "SBINDIR is ${SBINDIR}"
|
||||
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
|
||||
;;
|
||||
chain)
|
||||
@ -1428,7 +1428,7 @@ show_command() {
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
case "$g_program" in
|
||||
case "$PRODUCT" in
|
||||
*-lite)
|
||||
;;
|
||||
*)
|
||||
@ -3866,7 +3866,7 @@ get_config() {
|
||||
|
||||
ensure_config_path
|
||||
|
||||
config=$(find_file ${g_program}.conf)
|
||||
config=$(find_file ${PRODUCT}.conf)
|
||||
|
||||
if [ -f $config ]; then
|
||||
if [ -r $config ]; then
|
||||
@ -4362,6 +4362,7 @@ shorewall_cli() {
|
||||
g_nopager=
|
||||
g_blacklistipset=
|
||||
g_disconnect=
|
||||
g_options=
|
||||
|
||||
VERBOSE=
|
||||
VERBOSITY=1
|
||||
@ -4503,16 +4504,16 @@ shorewall_cli() {
|
||||
usage 1
|
||||
fi
|
||||
|
||||
setup_product_environment
|
||||
setup_product_environment 1
|
||||
|
||||
[ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std
|
||||
[ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
|
||||
MUTEX_TIMEOUT=
|
||||
|
||||
[ -f ${g_confdir}/vardir ] && . ${g_confdir}/vardir
|
||||
|
||||
[ -n "${VARDIR:=/var/lib/$g_program}" ]
|
||||
[ -n "${VARDIR:=/var/lib/$PRODUCT}" ]
|
||||
|
||||
g_firewall=${VARDIR}/firewall
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
SRWL=/sbin/shorewall-lite
|
||||
SRWL='/sbin/shorewall -l'
|
||||
SRWL_OPTS="-tvv"
|
||||
test -n ${INITLOG:=/var/log/shorewall-lite-init.log}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
|
||||
prog="shorewall-lite"
|
||||
prog="shorewall -l"
|
||||
shorewall="${SBINDIR}/$prog"
|
||||
logger="logger -i -t $prog"
|
||||
lockfile="/var/lock/subsys/$prog"
|
||||
|
@ -69,7 +69,7 @@ SHOREWALL_INIT_SCRIPT=1
|
||||
command="$action"
|
||||
|
||||
start() {
|
||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $STARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -l $OPTIONS $command $STARTOPTIONS
|
||||
}
|
||||
|
||||
boot() {
|
||||
@ -78,17 +78,17 @@ boot() {
|
||||
}
|
||||
|
||||
restart() {
|
||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $RESTARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -l $OPTIONS $command $RESTARTOPTIONS
|
||||
}
|
||||
|
||||
reload() {
|
||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $RELOADOPTION
|
||||
exec ${SBINDIR}/shorewall -l $OPTIONS $command $RELOADOPTION
|
||||
}
|
||||
|
||||
stop() {
|
||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $STOPOPTIONS
|
||||
exec ${SBINDIR}/shorewall -l $OPTIONS $command $STOPOPTIONS
|
||||
}
|
||||
|
||||
status() {
|
||||
exec ${SBINDIR}/shorewall-lite $OPTIONS $command $@
|
||||
exec ${SBINDIR}/shorewall -l $OPTIONS $command $@
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ require()
|
||||
#
|
||||
cd "$(dirname $0)"
|
||||
|
||||
if [ -f shorewall-lite ]; then
|
||||
if [ -f shorewall-lite.service ]; then
|
||||
PRODUCT=shorewall-lite
|
||||
Product="Shorewall Lite"
|
||||
else
|
||||
@ -331,7 +331,6 @@ if [ -n "$DESTDIR" ]; then
|
||||
OWNERSHIP=""
|
||||
fi
|
||||
|
||||
make_directory ${DESTDIR}${SBINDIR} 755
|
||||
make_directory ${DESTDIR}${INITDIR} 755
|
||||
|
||||
else
|
||||
@ -362,9 +361,9 @@ else
|
||||
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=""
|
||||
else
|
||||
first_install="Yes"
|
||||
@ -372,11 +371,8 @@ fi
|
||||
|
||||
delete_file ${DESTDIR}/usr/share/$PRODUCT/xmodules
|
||||
|
||||
install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0544
|
||||
[ -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
|
||||
#
|
||||
@ -498,7 +494,7 @@ done
|
||||
if [ -d manpages -a -n "$MANDIR" ]; then
|
||||
cd manpages
|
||||
|
||||
mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
|
||||
mkdir -p ${DESTDIR}${MANDIR}/man5/
|
||||
|
||||
for f in *.5; do
|
||||
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"
|
||||
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 ..
|
||||
|
||||
echo "Man Pages Installed"
|
||||
@ -539,6 +529,7 @@ fi
|
||||
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.common
|
||||
delete_file ${DESTDIR}${SHAREDIR}/$PRODUCT/lib.cli
|
||||
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
|
||||
@ -555,7 +546,6 @@ fi
|
||||
|
||||
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}${SBINDIR}/$PRODUCT
|
||||
fi
|
||||
|
||||
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
@ -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 $@
|
@ -103,7 +103,7 @@ require()
|
||||
|
||||
cd "$(dirname $0)"
|
||||
|
||||
if [ -f shorewall ]; then
|
||||
if [ -f shorewall.service ]; then
|
||||
PRODUCT=shorewall
|
||||
Product=Shorewall
|
||||
else
|
||||
@ -381,9 +381,9 @@ fi
|
||||
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=""
|
||||
else
|
||||
first_install="Yes"
|
||||
@ -394,10 +394,6 @@ if [ -z "${DESTDIR}" -a $PRODUCT = shorewall -a ! -f ${SHAREDIR}/$PRODUCT/coreve
|
||||
exit 1
|
||||
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
|
||||
#
|
||||
@ -468,6 +464,7 @@ if [ -z "$first_install" ]; then
|
||||
delete_file ${DESTDIR}/usr/share/shorewall6/lib.cli
|
||||
delete_file ${DESTDIR}/usr/share/shorewall6/lib.common
|
||||
delete_file ${DESTDIR}/usr/share/shorewall6/wait4ifup
|
||||
delete_file ${DESTDIR}/${SBINDIR}/shorewall6
|
||||
fi
|
||||
|
||||
delete_file ${DESTDIR}/usr/share/$PRODUCT/prog.header6
|
||||
@ -1179,7 +1176,7 @@ if [ -n "$MANDIR" ]; then
|
||||
|
||||
cd manpages
|
||||
|
||||
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/ ${DESTDIR}${MANDIR}/man8/
|
||||
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/
|
||||
|
||||
for f in *.5; do
|
||||
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"
|
||||
done
|
||||
|
||||
for f in *.8; do
|
||||
gzip -9c $f > $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"
|
||||
done
|
||||
if [ $PRODUCT = shorewall ]; then
|
||||
[ -n "$INSTALLD" ] || mkdir -p ${DESTDIR}${MANDIR}/man5/
|
||||
|
||||
for f in *.8; do
|
||||
gzip -9c $f > $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"
|
||||
done
|
||||
fi
|
||||
|
||||
cd ..
|
||||
|
||||
|
@ -48,10 +48,10 @@ get_config() {
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
config=$(find_file $g_program.conf)
|
||||
config=$(find_file ${PRODUCT}.conf)
|
||||
else
|
||||
[ -n "$g_shorewalldir" ] || fatal_error "Ordinary users may not $COMMAND the $CONFDIR/$g_program configuration"
|
||||
config="$g_shorewalldir/$g_program.conf"
|
||||
[ -n "$g_shorewalldir" ] || fatal_error "Ordinary users may not $COMMAND the $CONFDIR/$PRODUCT configuration"
|
||||
config="$g_shorewalldir/$PRODUCT.conf"
|
||||
fi
|
||||
|
||||
if [ -f $config ]; then
|
||||
@ -155,7 +155,7 @@ get_config() {
|
||||
if [ "$2" = Yes ]; then
|
||||
case $STARTUP_ENABLED in
|
||||
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)
|
||||
;;
|
||||
@ -397,8 +397,8 @@ compiler() {
|
||||
pc=${LIBEXECDIR}/shorewall/compiler.pl
|
||||
|
||||
if [ $(id -u) -ne 0 ]; then
|
||||
if [ -z "$g_shorewalldir" -o "$g_shorewalldir" = $CONFDIR/$g_program ]; then
|
||||
startup_error "Ordinary users may not $COMMAND the $CONFDIR/$g_program configuration"
|
||||
if [ -z "$g_shorewalldir" -o "$g_shorewalldir" = $CONFDIR/$PRODUCT ]; then
|
||||
startup_error "Ordinary users may not $COMMAND the $CONFDIR/$PRODUCT configuration"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
@ -1419,6 +1419,7 @@ remote_reload_command() # $* = original arguments less the command.
|
||||
sharedir=${SHAREDIR}
|
||||
local litedir
|
||||
local exitstatus
|
||||
local program
|
||||
|
||||
while [ $finished -eq 0 -a $# -gt 0 ]; do
|
||||
option=$1
|
||||
@ -1495,12 +1496,17 @@ remote_reload_command() # $* = original arguments less the command.
|
||||
sbindir="$SBINDIR"
|
||||
confdir="$CONFDIR"
|
||||
libexec="$LIBEXECDIR"
|
||||
litedir="${VARDIR}-lite"
|
||||
. $sharedir/shorewall/shorewallrc
|
||||
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
|
||||
|
||||
if [ -f $g_shorewalldir/${g_program}.conf ]; then
|
||||
if [ -f $g_shorewalldir/${PRODUCT}.conf ]; then
|
||||
if [ -f $g_shorewalldir/params ]; then
|
||||
. $g_shorewalldir/params
|
||||
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"
|
||||
fi
|
||||
else
|
||||
fatal_error "$g_shorewalldir/$g_program.conf does not exist"
|
||||
fatal_error "$g_shorewalldir/$PRODUCT.conf does not exist"
|
||||
fi
|
||||
|
||||
if [ -z "$getcaps" ]; then
|
||||
@ -1540,13 +1546,23 @@ remote_reload_command() # $* = original arguments less the command.
|
||||
file=$(resolve_file $g_shorewalldir/firewall)
|
||||
|
||||
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 "$litedir" ] || litedir=${VARLIB}/${g_program}-lite
|
||||
|
||||
g_file="$g_shorewalldir/firewall"
|
||||
|
||||
exitstatus=0
|
||||
@ -1557,30 +1573,29 @@ remote_reload_command() # $* = original arguments less the command.
|
||||
save=$(find_file save);
|
||||
|
||||
if [ -f $save ]; then
|
||||
progress_message3 "Copying $save to ${system}:${confdir}/${g_program}-lite/"
|
||||
rcp_command $save ${confdir}/shorewall-lite/
|
||||
progress_message3 "Copying $save to ${system}:${confdir}/${PRODUCT}-lite/"
|
||||
rcp_command $save ${confdir}/$PRODUCT/
|
||||
exitstatus=$?
|
||||
fi
|
||||
|
||||
if [ $exitstatus -eq 0 ]; then
|
||||
|
||||
progress_message3 "Copy complete"
|
||||
|
||||
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"
|
||||
else
|
||||
exitstatus=$?
|
||||
savit=
|
||||
fi
|
||||
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"
|
||||
else
|
||||
exitstatus=$?
|
||||
saveit=
|
||||
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"
|
||||
else
|
||||
exitstatus=$?
|
||||
@ -1588,7 +1603,7 @@ remote_reload_command() # $* = original arguments less the command.
|
||||
fi
|
||||
|
||||
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"
|
||||
else
|
||||
exitstatus=$?
|
||||
@ -1653,7 +1668,7 @@ export_command() # $* = original arguments less the command.
|
||||
target=$2
|
||||
;;
|
||||
*)
|
||||
fatal_error "Invalid command syntax (\"man $g_program\" for help)"
|
||||
fatal_error "Invalid command syntax (\"man shorewall\" for help)"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
SRWL=/sbin/shorewall6-lite
|
||||
SRWL='/sbin/shorewall6-lite -6'
|
||||
SRWL_OPTS="-tvv"
|
||||
test -n ${INITLOG:=/var/log/shorewall6-lite-init.log}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
|
||||
prog="shorewall6-lite"
|
||||
prog="shorewall -6l"
|
||||
shorewall="${SBINDIR}/$prog"
|
||||
logger="logger -i -t $prog"
|
||||
lockfile="/var/lock/subsys/$prog"
|
||||
|
@ -79,17 +79,17 @@ boot() {
|
||||
}
|
||||
|
||||
restart() {
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $RESTARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS $command $RESTARTOPTIONS
|
||||
}
|
||||
|
||||
reload() {
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $RELOADOPTION
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS $command $RELOADOPTION
|
||||
}
|
||||
|
||||
stop() {
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $STOPOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS $command $STOPOPTIONS
|
||||
}
|
||||
|
||||
status() {
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
|
||||
}
|
||||
|
@ -76,13 +76,13 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS start $STARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
@ -73,13 +73,13 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS start $STARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec ${SBINDIR}/shorewall6-lite $OPTIONS $command $@
|
||||
exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 $@
|
@ -14,8 +14,9 @@ Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/sysconfig/shorewall6-lite
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall6-lite $OPTIONS stop
|
||||
ExecStart=/sbin/shorewal -6l $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall -6l $OPTIONS stop
|
||||
ExecReload=/sbin/shorewall -6l $OPTIONS reload $RELOADOPTIONS
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
SRWL=/sbin/shorewall6
|
||||
SRWL='/sbin/shorewall -6'
|
||||
SRWL_OPTS="-tvv"
|
||||
WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
|
||||
test -n ${INITLOG:=/var/log/shorewall6-init.log}
|
||||
|
@ -25,7 +25,7 @@
|
||||
#
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
|
||||
prog="shorewall6"
|
||||
prog="shorewall -6"
|
||||
shorewall="${SBINDIR}/$prog"
|
||||
logger="logger -i -t $prog"
|
||||
lockfile="/var/lock/subsys/$prog"
|
||||
|
@ -77,13 +77,13 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec ${SBINDIR}/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec ${SBINDIR}/shorewall6 $OPTIONS restart $RESTARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec ${SBINDIR}/shorewall6 $OPTIONS $command $@
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS $command $@
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
@ -20,21 +20,21 @@ fi
|
||||
|
||||
start() {
|
||||
echo "Starting IPv6 shorewall rules..."
|
||||
exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||
exec /sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "Stopping IPv6 shorewall rules..."
|
||||
exec /sbin/shorewall6 stop
|
||||
exec /sbin/shorewall -6 stop
|
||||
}
|
||||
|
||||
restart() {
|
||||
echo "Restarting IPv6 shorewall rules..."
|
||||
exec /sbin/shorewall6 restart $RESTARTOPTIONS
|
||||
exec /sbin/shorewall -6 restart $RESTARTOPTIONS
|
||||
}
|
||||
|
||||
status() {
|
||||
exec /sbin/shorewall6 status
|
||||
exec /sbin/shorewall -6 status
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
@ -75,13 +75,16 @@ command="$1"
|
||||
|
||||
case "$command" in
|
||||
start)
|
||||
exec ${SBINDIR}/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS start $STARTOPTIONS
|
||||
;;
|
||||
restart|reload)
|
||||
exec ${SBINDIR}/shorewall6 $OPTIONS restart $RESTARTOPTIONS
|
||||
restart)
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS restart $RESTARTOPTIONS
|
||||
;;
|
||||
reload)
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS reload $RESTARTOPTIONS
|
||||
;;
|
||||
status|stop)
|
||||
exec ${SBINDIR}/shorewall6 $OPTIONS $command $@
|
||||
exec ${SBINDIR}/shorewall -6 $OPTIONS $command $@
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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 $@
|
@ -14,9 +14,9 @@ Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/sysconfig/shorewall6
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall6 $OPTIONS stop
|
||||
ExecReload=/sbin/shorewall6 $OPTIONS reload $RELOADOPTIONS
|
||||
ExecStart=/sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall -6 $OPTIONS stop
|
||||
ExecReload=/sbin/shorewall -6 $OPTIONS reload $RELOADOPTIONS
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
|
@ -15,9 +15,9 @@ Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/shorewall6
|
||||
StandardOutput=syslog
|
||||
ExecStart=/sbin/shorewall6 $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall6 $OPTIONS stop
|
||||
ExecReload=/sbin/shorewall6 $OPTIONS reload $RELOADOPTIONS
|
||||
ExecStart=/sbin/shorewall -6 $OPTIONS start $STARTOPTIONS
|
||||
ExecStop=/sbin/shorewall -6 $OPTIONS stop
|
||||
ExecReload=/sbin/shorewall -6 $OPTIONS reload $RELOADOPTIONS
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
|
Loading…
Reference in New Issue
Block a user