mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-22 10:41:23 +02:00
Allow log file to be specified indirectly in the params file
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6020 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
884f3b0616
commit
3ce7d7ef82
@ -54,7 +54,7 @@ Other changes in Shorewall 3.9.3
|
|||||||
I specify 'optional' on interfaces to Xen virtual machines that may
|
I specify 'optional' on interfaces to Xen virtual machines that may
|
||||||
or may not be running when Shorewall is [re]started.
|
or may not be running when Shorewall is [re]started.
|
||||||
|
|
||||||
2) The treatment of the followint interface options has changed under
|
2) The treatment of the following interface options has changed under
|
||||||
Shorewall-perl.
|
Shorewall-perl.
|
||||||
|
|
||||||
- arp_filter
|
- arp_filter
|
||||||
|
@ -120,6 +120,32 @@
|
|||||||
#
|
#
|
||||||
get_config() {
|
get_config() {
|
||||||
|
|
||||||
|
ensure_config_path
|
||||||
|
|
||||||
|
if [ "$1" = Yes ]; then
|
||||||
|
params=$(find_file params)
|
||||||
|
|
||||||
|
if [ -f $params ]; then
|
||||||
|
. $params
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
config=$(find_file shorewall.conf)
|
||||||
|
|
||||||
|
if [ -f $config ]; then
|
||||||
|
if [ -r $config ]; then
|
||||||
|
. $config
|
||||||
|
else
|
||||||
|
echo "Cannot read $config! (Hint: Are you root?)" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$config does not exist!" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
ensure_config_path
|
||||||
|
|
||||||
if [ -z "$EXPORT" -a "$(id -u)" = 0 ]; then
|
if [ -z "$EXPORT" -a "$(id -u)" = 0 ]; then
|
||||||
#
|
#
|
||||||
# This block is avoided for compile for export and when the user isn't root
|
# This block is avoided for compile for export and when the user isn't root
|
||||||
@ -1357,26 +1383,6 @@ for library in $LIBRARIES; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
ensure_config_path
|
|
||||||
|
|
||||||
config=$(find_file shorewall.conf)
|
|
||||||
|
|
||||||
if [ -f $config ]; then
|
|
||||||
if [ -r $config ]; then
|
|
||||||
. $config
|
|
||||||
else
|
|
||||||
echo "Cannot read $config! (Hint: Are you root?)" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "$config does not exist!" >&2
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
ensure_config_path
|
|
||||||
|
|
||||||
get_config
|
|
||||||
|
|
||||||
if [ ! -f $FIREWALL ]; then
|
if [ ! -f $FIREWALL ]; then
|
||||||
echo " ERROR: Shorewall is not properly installed" >&2
|
echo " ERROR: Shorewall is not properly installed" >&2
|
||||||
if [ -L $FIREWALL ]; then
|
if [ -L $FIREWALL ]; then
|
||||||
@ -1421,43 +1427,53 @@ COMMAND=$1
|
|||||||
|
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
start)
|
start)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
start_command $@
|
start_command $@
|
||||||
;;
|
;;
|
||||||
stop|reset|clear)
|
stop|reset|clear)
|
||||||
|
get_config
|
||||||
[ $# -ne 1 ] && usage 1
|
[ $# -ne 1 ] && usage 1
|
||||||
export NOROUTES
|
export NOROUTES
|
||||||
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $COMMAND
|
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $COMMAND
|
||||||
;;
|
;;
|
||||||
compile)
|
compile)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
compile_command $@
|
compile_command $@
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
restart_command $@
|
restart_command $@
|
||||||
;;
|
;;
|
||||||
refresh)
|
refresh)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
refresh_command $@
|
refresh_command $@
|
||||||
;;
|
;;
|
||||||
check)
|
check)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
check_command $@
|
check_command $@
|
||||||
;;
|
;;
|
||||||
add|delete)
|
add|delete)
|
||||||
|
get_config
|
||||||
[ $# -lt 3 ] && usage 1
|
[ $# -lt 3 ] && usage 1
|
||||||
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $@
|
exec $SHOREWALL_SHELL $FIREWALL $debugging $nolock $@
|
||||||
;;
|
;;
|
||||||
show|list)
|
show|list)
|
||||||
|
get_config Yes
|
||||||
shift
|
shift
|
||||||
show_command $@
|
show_command $@
|
||||||
;;
|
;;
|
||||||
load|reload)
|
load|reload)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
reload_command $@
|
reload_command $@
|
||||||
;;
|
;;
|
||||||
export)
|
export)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
export_command $@
|
export_command $@
|
||||||
;;
|
;;
|
||||||
@ -1488,10 +1504,12 @@ case "$COMMAND" in
|
|||||||
exit $status
|
exit $status
|
||||||
;;
|
;;
|
||||||
dump)
|
dump)
|
||||||
|
get_config Yes
|
||||||
shift
|
shift
|
||||||
dump_command $@
|
dump_command $@
|
||||||
;;
|
;;
|
||||||
hits)
|
hits)
|
||||||
|
get_config Yes
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
[ $# -eq 1 ] || usage 1
|
[ $# -eq 1 ] || usage 1
|
||||||
hits_command
|
hits_command
|
||||||
@ -1500,13 +1518,16 @@ case "$COMMAND" in
|
|||||||
echo $version
|
echo $version
|
||||||
;;
|
;;
|
||||||
try)
|
try)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
try_command $@
|
try_command $@
|
||||||
;;
|
;;
|
||||||
logwatch)
|
logwatch)
|
||||||
|
get_config Yes
|
||||||
logwatch_command $@
|
logwatch_command $@
|
||||||
;;
|
;;
|
||||||
drop)
|
drop)
|
||||||
|
get_config
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
[ $# -eq 1 ] && usage 1
|
[ $# -eq 1 ] && usage 1
|
||||||
if shorewall_is_started ; then
|
if shorewall_is_started ; then
|
||||||
@ -1518,6 +1539,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
logdrop)
|
logdrop)
|
||||||
|
get_config
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
[ $# -eq 1 ] && usage 1
|
[ $# -eq 1 ] && usage 1
|
||||||
if shorewall_is_started ; then
|
if shorewall_is_started ; then
|
||||||
@ -1529,6 +1551,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
reject|logreject)
|
reject|logreject)
|
||||||
|
get_config
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
[ $# -eq 1 ] && usage 1
|
[ $# -eq 1 ] && usage 1
|
||||||
if shorewall_is_started ; then
|
if shorewall_is_started ; then
|
||||||
@ -1540,9 +1563,11 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
allow)
|
allow)
|
||||||
|
get_config
|
||||||
allow_command $@
|
allow_command $@
|
||||||
;;
|
;;
|
||||||
save)
|
save)
|
||||||
|
get_config
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
|
|
||||||
case $# in
|
case $# in
|
||||||
@ -1567,6 +1592,7 @@ case "$COMMAND" in
|
|||||||
[ "$nolock" ] || mutex_off
|
[ "$nolock" ] || mutex_off
|
||||||
;;
|
;;
|
||||||
forget)
|
forget)
|
||||||
|
get_config
|
||||||
case $# in
|
case $# in
|
||||||
1)
|
1)
|
||||||
;;
|
;;
|
||||||
@ -1650,10 +1676,12 @@ case "$COMMAND" in
|
|||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
restore)
|
restore)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
restore_command $@
|
restore_command $@
|
||||||
;;
|
;;
|
||||||
call)
|
call)
|
||||||
|
get_config
|
||||||
[ -n "$debugging" ] && set -x
|
[ -n "$debugging" ] && set -x
|
||||||
#
|
#
|
||||||
# Undocumented way to call functions in ${SHAREDIR}/functions directly
|
# Undocumented way to call functions in ${SHAREDIR}/functions directly
|
||||||
@ -1666,6 +1694,7 @@ case "$COMMAND" in
|
|||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
safe-restart|safe-start)
|
safe-restart|safe-start)
|
||||||
|
get_config
|
||||||
shift
|
shift
|
||||||
safe_commands $@
|
safe_commands $@
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user