Clean up the output of 'blacklist'

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-10-10 13:26:01 -07:00
parent 8c522a5c4d
commit b3e59322b6
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -3561,17 +3561,16 @@ blacklist_command() {
progress_message2 "$1 Blacklisted"
if [ -n "$g_disconnect" ]; then
message=$(conntrack -D -s $1 2>&1)
if [ -n "$message" ]; then
message=$(echo $message | sed 's/^.*: //; s/ / src /')
progress_message2 $message
message="$(conntrack -D -s $1 2>&1)"
if [ -n "$message" -a $VERBOSITY -gt 0 ]; then
echo "$message" | sed 's/^.*: //; s/ / dst /'
echo "$message" | awk '/have been deleted/ { sub( /^.*: /, "" ); sub( / /, " src " ); }; { print; }'
fi
if [ $g_disconnect = src-dst ]; then
message=$(conntrack -D -d $1 2>&1)
if [ -n "$message" ]; then
message=$(echo $message | sed 's/^.*: //; s/ / dst /')
progress_message2 $message
message="$(conntrack -D -d $1 2>&1)"
if [ -n "$message" -a $VERBOSITY -gt 0 ]; then
echo "$message" | awk '/have been deleted/ { sub( /^.*: /, "" ); sub( / /, " dst " ); }; { print; }'
fi
fi
fi