mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Display the current time as an integer in 'show event[s]' output
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
282bf0a78c
commit
5c7500e13e
@ -730,9 +730,14 @@ show_nfacct() {
|
||||
}
|
||||
|
||||
show_events() {
|
||||
local file
|
||||
local base
|
||||
|
||||
if [ -f /proc/net/xt_recent/%CURRENTTIME ]; then
|
||||
echo -127.0.0.1 > /proc/net/xt_recent/%CURRENTTIME
|
||||
echo +127.0.0.1 > /proc/net/xt_recent/%CURRENTTIME
|
||||
echo Current time: $(cat /proc/net/xt_recent/%CURRENTTIME | cut -d ' ' -f 5 -)
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
@ -747,9 +752,13 @@ show_events() {
|
||||
done
|
||||
else
|
||||
for file in /proc/net/xt_recent/*; do
|
||||
base=$(basename $file)
|
||||
|
||||
if [ $base != %CURRENTTIME ]; then
|
||||
echo $(basename $file)
|
||||
cat $file
|
||||
echo
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
@ -512,7 +512,9 @@ EOF
|
||||
emit(
|
||||
' run_refreshed_exit',
|
||||
' do_iptables -N shorewall' );
|
||||
emit ( ' do_iptables -A shorewall -m recent --set --name \%CURRENTTIME' ) if have_capability 'RECENT_MATCH';
|
||||
|
||||
emit ( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH';
|
||||
|
||||
emit(
|
||||
" set_state Started $config_dir",
|
||||
' [ $0 = ${VARDIR}/firewall ] || cp -f $(my_pathname) ${VARDIR}/firewall',
|
||||
@ -537,7 +539,7 @@ EOF
|
||||
do_iptables -N shorewall
|
||||
EOF
|
||||
|
||||
emit ( ' do_iptables -A shorewall -m recent --set --name \%CURRENTTIME' ) if have_capability 'RECENT_MATCH';
|
||||
emit ( ' do_iptables -A shorewall -m recent --set --name %CURRENTTIME' ) if have_capability 'RECENT_MATCH';
|
||||
|
||||
emit<<"EOF";
|
||||
set_state Started $config_dir
|
||||
|
Loading…
Reference in New Issue
Block a user