mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-24 00:23:28 +01:00
Pass arguments to user exits
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4399 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
426641a572
commit
6ab40df245
@ -2201,14 +2201,16 @@ process_action() # $1 = chain (Chain to add the rules to)
|
||||
#
|
||||
# Source the extension script for an action, if any
|
||||
#
|
||||
process_action_file() # $1 = File Name
|
||||
process_action_file() # $1 = File Name, $2 - n = Arguments
|
||||
{
|
||||
local user_exit=$(find_file $1)
|
||||
|
||||
shift
|
||||
|
||||
if [ -f $user_exit ]; then
|
||||
progress_message "Processing $user_exit ..."
|
||||
|
||||
. $user_exit
|
||||
. $user_exit $@
|
||||
fi
|
||||
}
|
||||
|
||||
@ -2265,7 +2267,7 @@ createlogactionchain() # $1 = Action Name, $2 = Log Level [: Log Tag ]
|
||||
|
||||
[ none = "${LEVEL%\!}" ] && LEVEL=
|
||||
|
||||
process_action_file $1
|
||||
process_action_file $1 "$CHAIN" "$LEVEL" "$TAG"
|
||||
|
||||
eval ${action}_chains=\"\$${action}_chains $level $CHAIN\"
|
||||
|
||||
@ -2508,7 +2510,7 @@ process_actions1() {
|
||||
verify_macro_from_action
|
||||
else
|
||||
rule="$xtarget $xclients $xservers $xprotocol $xports $xcports $xratelimit $xuserspec"
|
||||
fatal_error "Invalid TARGET in rule \"$rule\""
|
||||
fatal_error "Invalid TARGET in rule \"$rule\" (do you need the clib.macros Shorewall Library?)"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@ -6726,14 +6728,18 @@ do_initialize() {
|
||||
FUNCTIONS=${SHAREDIR}/functions
|
||||
|
||||
[ -n "${VERBOSE:=2}" ]
|
||||
|
||||
#
|
||||
# Load Libraries shared with run-time
|
||||
#
|
||||
if [ -f $FUNCTIONS ]; then
|
||||
[ $VERBOSE -ge 2 ] && echo "Loading $FUNCTIONS..."
|
||||
. $FUNCTIONS
|
||||
else
|
||||
fatal_error "$FUNCTIONS does not exist!"
|
||||
fi
|
||||
|
||||
#
|
||||
# Load compiler libraries
|
||||
#
|
||||
for clib in ${SHAREDIR}/clib.*; do
|
||||
case $clib in
|
||||
${SHAREDIR}/clib.\*)
|
||||
|
Loading…
Reference in New Issue
Block a user