File: check_counters

package info (click to toggle)
ipset 7.24-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,376 kB
  • sloc: ansic: 32,867; sh: 5,855; makefile: 246; awk: 3
file content (11 lines) | stat: -rwxr-xr-x 205 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

ipset=${IPSET_BIN:-../src/ipset}

read ip p packets b bytes <<< $($ipset l $1 | grep ^$2)
test -z "$packets" -o -z "$bytes" && exit 1
test $packets -ne $3 -o $bytes -ne $4 && exit 1
exit 0