Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/network/shorewall_acc | ||
|---|---|---|
| 6 | 6 |
# Released under the GPL v2 |
| 7 | 7 |
import sys, commands, re |
| 8 | 8 |
accountingLineExp = re.compile(r"^\s*\d+[KMG]*\s+(\d+)([KMGT]*)\s+(\w+).*$") |
| 9 |
|
|
| 9 |
|
|
| 10 | 10 |
def getBytesByChain(): |
| 11 | 11 |
trafficCmd = "shorewall" |
| 12 | 12 |
status, output = commands.getstatusoutput("/sbin/shorewall show accounting 2>/dev/null")
|
| ... | ... | |
| 41 | 41 |
for name in chainNames: |
| 42 | 42 |
retval.append((name, chains[name])) |
| 43 | 43 |
return retval |
| 44 |
|
|
| 44 |
|
|
| 45 | 45 |
if len(sys.argv) > 1: |
| 46 | 46 |
if sys.argv[1] == "autoconf": |
| 47 | 47 |
print "yes" |
| ... | ... | |
| 56 | 56 |
print "%s.label %s" % (chain, chain) |
| 57 | 57 |
print "%s.cdef %s,8,*" % (chain, chain) |
| 58 | 58 |
sys.exit(0) |
| 59 |
|
|
| 59 |
|
|
| 60 | 60 |
for chain, bytes in getBytesByChain(): |
| 61 | 61 |
print "%s.value %i" % (chain, bytes) |
Formats disponibles : Unified diff