mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-23 22:58:52 +01:00
Add lib.user extension script
This commit is contained in:
parent
793ecd5c73
commit
01d046fac9
@ -97,6 +97,9 @@ sub generate_script_1() {
|
|||||||
# Functions to execute the various user exits (extension scripts)
|
# Functions to execute the various user exits (extension scripts)
|
||||||
################################################################################
|
################################################################################
|
||||||
EOF
|
EOF
|
||||||
|
my $lib = find_file 'lib.user';
|
||||||
|
|
||||||
|
copy1 $lib, emit "\n" if -f $lib;
|
||||||
|
|
||||||
for my $exit qw/init isusable start tcclear started stop stopped clear refresh refreshed restored findgw/ {
|
for my $exit qw/init isusable start tcclear started stop stopped clear refresh refreshed restored findgw/ {
|
||||||
emit "\nrun_${exit}_exit() {";
|
emit "\nrun_${exit}_exit() {";
|
||||||
|
@ -79,6 +79,7 @@ our %EXPORT_TAGS = ( internal => [ qw( create_temp_object
|
|||||||
push_indent
|
push_indent
|
||||||
pop_indent
|
pop_indent
|
||||||
copy
|
copy
|
||||||
|
copy1
|
||||||
create_temp_aux_config
|
create_temp_aux_config
|
||||||
finalize_aux_config
|
finalize_aux_config
|
||||||
set_shorewall_dir
|
set_shorewall_dir
|
||||||
@ -1088,6 +1089,8 @@ sub copy1( $ ) {
|
|||||||
|
|
||||||
close IF;
|
close IF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$lastlineblank = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -20,6 +20,8 @@ Changes in Shorewall 4.4.0-Beta2
|
|||||||
|
|
||||||
8) Add 'USER/GROUP' column to masq file.
|
8) Add 'USER/GROUP' column to masq file.
|
||||||
|
|
||||||
|
9) Added lib.user.
|
||||||
|
|
||||||
Changes in Shorewall 4.4.0-Beta1
|
Changes in Shorewall 4.4.0-Beta1
|
||||||
|
|
||||||
1) Correct typo in Shorewall6 two-interface sample shorewall.conf.
|
1) Correct typo in Shorewall6 two-interface sample shorewall.conf.
|
||||||
|
14
Shorewall/configfiles/lib.user
Normal file
14
Shorewall/configfiles/lib.user
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#
|
||||||
|
# Shorewall version 4 - lib.user File
|
||||||
|
#
|
||||||
|
# /etc/shorewall/lib.user
|
||||||
|
#
|
||||||
|
# Use this file to declare shell functions to be called in the other
|
||||||
|
# run-time extension scripts. The file will be copied into the generated
|
||||||
|
# firewall script.
|
||||||
|
#
|
||||||
|
# See http://shorewall.net/shorewall_extension_scripts.htm for additional
|
||||||
|
# information.
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE
|
@ -180,6 +180,10 @@ None.
|
|||||||
column works similarly to USER/GROUP columns in other Shorewall
|
column works similarly to USER/GROUP columns in other Shorewall
|
||||||
configuration files. Only locally-generated traffic is matched.
|
configuration files. Only locally-generated traffic is matched.
|
||||||
|
|
||||||
|
4) A new extension script, 'lib.user' has been added. This file is
|
||||||
|
intended to include declarations of shell functions that are called
|
||||||
|
by the other run-time extension scripts.
|
||||||
|
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
N E W F E A T U R E S IN 4 . 4
|
N E W F E A T U R E S IN 4 . 4
|
||||||
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
||||||
|
@ -1355,6 +1355,10 @@ fi</programlisting></para>
|
|||||||
|
|
||||||
<para><filename>/etc/shorewall/isusable</filename>:</para>
|
<para><filename>/etc/shorewall/isusable</filename>:</para>
|
||||||
|
|
||||||
|
<para>Note that <filename>/etc/lsm/script </filename>writes
|
||||||
|
a<filename> ${VARDIR}/xxx.status</filename> file when the status of an
|
||||||
|
interface changes. </para>
|
||||||
|
|
||||||
<programlisting>local status=0
|
<programlisting>local status=0
|
||||||
|
|
||||||
[ -f ${VARDIR}/${1}.status ] && status=$(cat ${VARDIR}/${1}.status)
|
[ -f ${VARDIR}/${1}.status ] && status=$(cat ${VARDIR}/${1}.status)
|
||||||
@ -1378,7 +1382,7 @@ connection {
|
|||||||
|
|
||||||
connection {
|
connection {
|
||||||
name=Comcast
|
name=Comcast
|
||||||
checkip=$ETH3_GATEWAY
|
checkip=${ETH3_GATEWAY:-71.227.156.1}
|
||||||
device=eth3
|
device=eth3
|
||||||
ttl=1
|
ttl=1
|
||||||
}
|
}
|
||||||
@ -1388,7 +1392,8 @@ EOF
|
|||||||
fi</programlisting>
|
fi</programlisting>
|
||||||
|
|
||||||
<para>eth3 has a dynamic IP address so I need to use the
|
<para>eth3 has a dynamic IP address so I need to use the
|
||||||
Shorewall-detected gateway address ($ETH3_GATEWAY).</para>
|
Shorewall-detected gateway address ($ETH3_GATEWAY). I supply a default
|
||||||
|
value in the event that detection fails.</para>
|
||||||
|
|
||||||
<para><filename>/etc/shorewall/restored</filename>:</para>
|
<para><filename>/etc/shorewall/restored</filename>:</para>
|
||||||
|
|
||||||
|
@ -69,6 +69,12 @@
|
|||||||
<para>The following scripts can be supplied:</para>
|
<para>The following scripts can be supplied:</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para><filename>lib.user</filename> -- Intended to contain
|
||||||
|
declarations of shell functions to be called by other run-time
|
||||||
|
extension scripts.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><filename>compile</filename> -- Invoked by the rules compiler
|
<para><filename>compile</filename> -- Invoked by the rules compiler
|
||||||
early in the compilation process. Must be written in Perl.</para>
|
early in the compilation process. Must be written in Perl.</para>
|
||||||
|
Loading…
Reference in New Issue
Block a user