reverted rev 82
[grml-scripts.git] / usr_sbin / grml-iptstate
1 #!/bin/sh
2 # Filename:      grml-iptstate
3 # Purpose:       wrapper around iptstate (top-like display of IP Tables state table entries)
4 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 # Latest change: Don Okt 12 17:20:59 CEST 2006 [mika]
8 ################################################################################
9
10 . /etc/grml/script-functions
11 check4progs iptstate || exit 1
12
13 if grep -q ip_conntrack /proc/modules ; then
14    iptstate
15 else
16    echo "Module ip_conntrack is not present. Can not start iptstate therefore."
17    echo -n "Do you want to load it and invoke iptstate afterwards? [YES|no] "
18    read a
19    if [ "$a" = YES -o "$a" = yes -o "$a" = '' -o "$a" = y -o "$a" = Y ] ; then
20       modprobe ip_conntrack && exec iptstate
21    else
22       echo "Aborting as requested."
23       exit 1
24    fi
25 fi
26
27 ## END OF FILE #################################################################