4 # Copyright (C) 2009 Universita` di Pisa
7 # This script parse the ipfw rules
8 # and remove the old ones.
10 # The ipfw output is parsed and each time
11 # value stored as comment is compared against
13 # If the time value is older than current,
14 # the rules and related pipes will be deleted.
19 # Get $NOW referred to UTC
22 # check for module existence
23 /sbin/lsmod | grep ipfw
24 if [ x"$?" == x"1" ]; then
25 echo "ipfw module does not exist";
32 print now a "Start to clean rules ";
36 # delete rules and pipes
37 function delete_rule(rule_id) {
38 command="/sbin/ipfw delete " rule_id "; ipfw pipe delete " rule_id;
43 /\/\/\ [0-9]*/ { # select timeout string
53 END { print " " cleaned " rules cleaned";