mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-03 03:59:16 +01:00
Record the config directory in the state file
This commit is contained in:
parent
36054b7784
commit
7281c9166e
@ -442,32 +442,37 @@ EOF
|
|||||||
setup_forwarding( $family , 1 );
|
setup_forwarding( $family , 1 );
|
||||||
push_indent;
|
push_indent;
|
||||||
|
|
||||||
emit<<'EOF';
|
my $config_dir = $globals{CONFIGDIR};
|
||||||
set_state "Started"
|
|
||||||
|
emit<<"EOF";
|
||||||
|
set_state Started $config_dir
|
||||||
run_restored_exit
|
run_restored_exit
|
||||||
else
|
else
|
||||||
if [ $COMMAND = refresh ]; then
|
if [ \$COMMAND = refresh ]; then
|
||||||
chainlist_reload
|
chainlist_reload
|
||||||
EOF
|
EOF
|
||||||
setup_forwarding( $family , 0 );
|
setup_forwarding( $family , 0 );
|
||||||
|
|
||||||
emit<<'EOF';
|
emit<<"EOF";
|
||||||
run_refreshed_exit
|
run_refreshed_exit
|
||||||
do_iptables -N shorewall
|
do_iptables -N shorewall
|
||||||
set_state "Started"
|
set_state Started $config_dir
|
||||||
else
|
else
|
||||||
setup_netfilter
|
setup_netfilter
|
||||||
conditionally_flush_conntrack
|
conditionally_flush_conntrack
|
||||||
EOF
|
EOF
|
||||||
setup_forwarding( $family , 0 );
|
setup_forwarding( $family , 0 );
|
||||||
|
|
||||||
emit<<'EOF';
|
emit<<"EOF";
|
||||||
run_start_exit
|
run_start_exit
|
||||||
do_iptables -N shorewall
|
do_iptables -N shorewall
|
||||||
set_state "Started"
|
set_state Started $config_dir
|
||||||
run_started_exit
|
run_started_exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
emit<<'EOF';
|
||||||
[ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall
|
[ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -339,6 +339,7 @@ sub initialize( $ ) {
|
|||||||
%globals = ( SHAREDIR => '/usr/share/shorewall' ,
|
%globals = ( SHAREDIR => '/usr/share/shorewall' ,
|
||||||
SHAREDIRPL => '/usr/share/shorewall/' ,
|
SHAREDIRPL => '/usr/share/shorewall/' ,
|
||||||
CONFDIR => '/etc/shorewall',
|
CONFDIR => '/etc/shorewall',
|
||||||
|
CONFIGDIR => '',
|
||||||
LOGPARMS => '',
|
LOGPARMS => '',
|
||||||
TC_SCRIPT => '',
|
TC_SCRIPT => '',
|
||||||
EXPORT => 0,
|
EXPORT => 0,
|
||||||
@ -2719,6 +2720,9 @@ sub process_shorewall_conf() {
|
|||||||
my $file = find_file "$product.conf";
|
my $file = find_file "$product.conf";
|
||||||
|
|
||||||
if ( -f $file ) {
|
if ( -f $file ) {
|
||||||
|
$globals{CONFIGDIR} = $file;
|
||||||
|
$globals{CONFIGDIR} =~ s/$product.conf//;
|
||||||
|
|
||||||
if ( -r _ ) {
|
if ( -r _ ) {
|
||||||
open_file $file;
|
open_file $file;
|
||||||
|
|
||||||
|
@ -514,9 +514,13 @@ find_file()
|
|||||||
#
|
#
|
||||||
# Set the Shorewall state
|
# Set the Shorewall state
|
||||||
#
|
#
|
||||||
set_state () # $1 = state
|
set_state () # $1 = state $2
|
||||||
{
|
{
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
echo "$1 ($(date)) from $2" > ${VARDIR}/state
|
||||||
|
else
|
||||||
echo "$1 ($(date))" > ${VARDIR}/state
|
echo "$1 ($(date))" > ${VARDIR}/state
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -452,7 +452,11 @@ find_file()
|
|||||||
#
|
#
|
||||||
set_state () # $1 = state
|
set_state () # $1 = state
|
||||||
{
|
{
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
echo "$1 ($(date)) from $2" > ${VARDIR}/state
|
||||||
|
else
|
||||||
echo "$1 ($(date))" > ${VARDIR}/state
|
echo "$1 ($(date))" > ${VARDIR}/state
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user