Chenbo Feng | 51570a5 | 2017-03-22 17:27:36 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
2 | local_dir="$(pwd)" | ||||
3 | root_dir=$local_dir/../.. | ||||
4 | mnt_dir=$(mktemp -d --tmp) | ||||
5 | |||||
6 | on_exit() { | ||||
7 | iptables -D INPUT -m bpf --object-pinned ${mnt_dir}/bpf_prog -j ACCEPT | ||||
8 | umount ${mnt_dir} | ||||
9 | rm -r ${mnt_dir} | ||||
10 | } | ||||
11 | |||||
12 | trap on_exit EXIT | ||||
13 | mount -t bpf bpf ${mnt_dir} | ||||
14 | ./per_socket_stats_example ${mnt_dir}/bpf_prog |