merged grml-quickconfig nonblocking branch
[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 . /etc/grml/lsb-functions
12 check4progs iptstate || exit 1
13
14 if grep -q '_conntrack' /proc/modules ; then
15    iptstate
16 else
17    einfo "iptstate is a top-like display of IP Tables state table entries."
18    echo
19    ewarn "Module ip_conntrack is not present. Can not start iptstate therefore."
20    eindent
21      einfon "Do you want to load it and invoke iptstate afterwards? [YES|no] "
22      read a
23      if [ "$a" = YES -o "$a" = yes -o "$a" = '' -o "$a" = y -o "$a" = Y ] ; then
24         modprobe ip_conntrack ; RC=$?
25         eend $RC
26         [ "$RC" = 0 ] && exec iptstate
27      else
28         echo "Aborting as requested."
29         exit 1
30      fi
31 fi
32
33 ## END OF FILE #################################################################