Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
luckman212 committed Jun 7, 2022
1 parent f3c5a8f commit 1ae244c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

pfctl -vvss |
awk -v m="$1" '
/sbin/pfctl -vvss |
/usr/bin/awk -v m="$1" '
BEGIN {
printf("%-14s %-8s %-4s %-26s %-24s %s\n",
"proto/dir","iface","rule","state/creator","state","talkers");
Expand All @@ -12,12 +12,12 @@ awk -v m="$1" '
rid=""; sid=""; gw=""; iface=""; talkers="";
proto=$2; st=$NF;
i=3; while (i<NF) {
talkers=sprintf("%s%s ",talkers,$i);
talkers=sprintf("%s%s ", talkers, $i);
if($i=="->") { dir="out"; }
if($i=="<-") { dir="in"; }
i++;
}
proto_dir=sprintf("%s %s", proto, dir);
proto_dir=sprintf("%s/%s", proto, dir);
next;
}
{
Expand All @@ -44,10 +44,10 @@ awk -v m="$1" '
}
{
#print "recno: "NR " output";
mm=sprintf("%%%s%%%s%%%s%%%s%%%s%%%s%%",proto_dir,iface,rid,sid,st,talkers,gw);
mm=sprintf("%%%s%%%s%%%s%%%s%%%s%%%s%%", proto_dir, iface, rid, sid, st, talkers, gw);
if(mm ~ m) {
printf "%-14s %-8s %-4s %-26s %-24s %s%s\n",
proto_dir,iface,rid,sid,st,talkers,gw;
proto_dir, iface, rid, sid, st, talkers, gw;
cnt++;
}
}
Expand Down

0 comments on commit 1ae244c

Please sign in to comment.