1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#!/bin/dash
# file: example.other_debug
# copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
# license: GNU General Public License, version 3
# description: example to test debug features "overwriting dbgcmd" provided by shellia
# to dynamically configure iptables logging
# see also: test.other_debug
set -e
set -u
. ./ia.debug
dbgcmd()
{
# to enable, delete "echo" in next line to look like: "$@"
echo "$@"
}
[ "${1:-}" = "-d" ] && dbgon "${2:-}"
dbg 3 IPv4 iptables -A INPUT -j LOG --log-prefix "iptables IPv4-INPUT: "
dbg 3 IPv6 ip6tables -A INPUT -j LOG --log-prefix "iptables IPV6-INPUT: "
|