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