File: example.debug_iptables

package info (click to toggle)
shellia 5.10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 792 kB
  • sloc: sh: 7,840; makefile: 34
file content (23 lines) | stat: -rwxr-xr-x 650 bytes parent folder | download | duplicates (4)
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: "