mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Refine the 'run' command
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
eb5026d3b7
commit
31e5aeeaea
@ -3515,6 +3515,14 @@ restart_command() {
|
||||
return $rc
|
||||
}
|
||||
|
||||
run_command() {
|
||||
if [ -x ${VARDIR}/firewall ] ; then
|
||||
run_it ${VARDIR}/firewall $g_debugging $@
|
||||
else
|
||||
fatal_error "${VARDIR}/firewall does not exist or is not executable"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Give Usage Information
|
||||
#
|
||||
@ -3820,12 +3828,9 @@ shorewall_cli() {
|
||||
fi
|
||||
;;
|
||||
run)
|
||||
[ $# -gt 1 ] || fatal_error "Missing function name"
|
||||
get_config Yes
|
||||
if [ -x ${VARDIR}/firewall ] ; then
|
||||
run_it ${VARDIR}/firewall $g_debugging $@
|
||||
else
|
||||
fatal_error "${VARDIR}/firewall does not exist or is not executable"
|
||||
fi
|
||||
run_command $@
|
||||
;;
|
||||
show|list|ls)
|
||||
get_config Yes No Yes
|
||||
|
@ -841,12 +841,11 @@
|
||||
<term><emphasis role="bold">run</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.6.3. Calls the named
|
||||
<replaceable>function</replaceable> passing the supplied
|
||||
<replaceable>parameter</replaceable>s. The
|
||||
<replaceable>function</replaceable> will normally be declared in
|
||||
<filename>lib.private</filename> and is executed in the context of
|
||||
the generated firewall script.</para>
|
||||
<para>Added in Shorewall 4.6.3. Executes
|
||||
<replaceable>command</replaceable> in the context of the generated
|
||||
script passing the supplied <replaceable>parameter</replaceable>s.
|
||||
Normally, the <replaceable>command</replaceable> will be a function
|
||||
declared in <filename>lib.private</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -374,7 +374,9 @@ case "$COMMAND" in
|
||||
;;
|
||||
run)
|
||||
shift
|
||||
detect_configuration
|
||||
eval $@
|
||||
status=$?
|
||||
;;
|
||||
version)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
|
@ -1615,6 +1615,15 @@ export_command() # $* = original arguments less the command.
|
||||
fi
|
||||
}
|
||||
|
||||
run_command() {
|
||||
if [ -x ${VARDIR}/firewall ] ; then
|
||||
uptodate ${VARDIR}/firewall || echo " WARNING: ${VARDIR}/firewall is not up to date" >&2
|
||||
run_it ${VARDIR}/firewall $g_debugging $@
|
||||
else
|
||||
fatal_error "${VARDIR}/firewall does not exist or is not executable"
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Give Usage Information
|
||||
#
|
||||
|
@ -1428,12 +1428,20 @@
|
||||
<term><emphasis role="bold">run</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.6.3. Calls the named
|
||||
<replaceable>function</replaceable> passing the supplied
|
||||
<replaceable>parameter</replaceable>s. The
|
||||
<replaceable>function</replaceable> will normally be declared in
|
||||
<filename>lib.private</filename> and is executed in the context of
|
||||
the generated firewall script.</para>
|
||||
<para>Added in Shorewall 4.6.3. Executes
|
||||
<replaceable>command</replaceable> in the context of the generated
|
||||
script passing the supplied <replaceable>parameter</replaceable>s.
|
||||
Normally, the <replaceable>command</replaceable> will be a function
|
||||
declared in <filename>lib.private</filename>.</para>
|
||||
|
||||
<para>If there are files in the CONFIG_PATH that were modified after
|
||||
the current firewall script was generated, the following warning
|
||||
message is issued:</para>
|
||||
|
||||
<simplelist>
|
||||
<member>WARNING: /var/lib/shorewall/firewall is not up to
|
||||
date</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -327,7 +327,7 @@
|
||||
|
||||
<arg choice="plain"><option>run</option></arg>
|
||||
|
||||
<arg choice="plain">function</arg>
|
||||
<arg choice="plain">command</arg>
|
||||
|
||||
<arg><replaceable>parameter ...</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
@ -839,12 +839,11 @@
|
||||
<term><emphasis role="bold">run</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.6.3. Calls the named
|
||||
<replaceable>function</replaceable> passing the supplied
|
||||
<replaceable>parameter</replaceable>s. The
|
||||
<replaceable>function</replaceable> will normally be declared in
|
||||
<filename>lib.private</filename> and is executed in the context of
|
||||
the generated firewall script.</para>
|
||||
<para>Added in Shorewall 4.6.3. Executes
|
||||
<replaceable>command</replaceable> in the context of the generated
|
||||
script passing the supplied <replaceable>parameter</replaceable>s.
|
||||
Normally, the <replaceable>command</replaceable> will be a function
|
||||
declared in <filename>lib.private</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -1309,12 +1309,21 @@
|
||||
<term><emphasis role="bold">run</emphasis></term>
|
||||
|
||||
<listitem>
|
||||
<para>Added in Shorewall 4.6.3. Calls the named
|
||||
<replaceable>function</replaceable> passing the supplied
|
||||
<replaceable>parameter</replaceable>s. The
|
||||
<replaceable>function</replaceable> will normally be declared in
|
||||
<filename>lib.private</filename> and is executed in the context of
|
||||
the generated firewall script.</para>
|
||||
<para>Added in Shorewall 4.6.3. Executes
|
||||
<replaceable>command</replaceable> in the context of the generated
|
||||
script passing the supplied <replaceable>parameter</replaceable>s.
|
||||
Normally, the <replaceable>command</replaceable> will be a function
|
||||
declared in <filename>lib.private</filename>.</para>
|
||||
|
||||
<para>If there are files in the CONFIG_PATH that were modified after
|
||||
the current firewall script was generated, the following warning
|
||||
message is issued before the script's run command is
|
||||
executed:</para>
|
||||
|
||||
<simplelist>
|
||||
<member>WARNING: /var/lib/shorewall6/firewall is not up to
|
||||
date</member>
|
||||
</simplelist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user