Skip to content

Instantly share code, notes, and snippets.

@jlongman
Created May 11, 2015 21:41
Show Gist options
  • Save jlongman/03565433e74a87618593 to your computer and use it in GitHub Desktop.
Save jlongman/03565433e74a87618593 to your computer and use it in GitHub Desktop.
ipfw show highlighting
#!/bin/sh
# requires line_lite.sh: https://brianin3d.wordpress.com/2008/05/14/scripting-with-ansi-color-codes/
ipfw show | ./line_lite.sh '\*\*\*' green:underline | ./line_lite.sh 'tag.*123' bright
# WIDE - 2 columns - must add pr from a freebsd host
ipfw show | ./line_lite.sh '\*\*\*' green:underline | ./pr -2 -t -w 300 -
ipfw show | ./line_lite.sh '\*\*\*' green:underline | ./line_lite.sh "stat:" bright | ./pr -2 -t -w 300 -
# live update
while 1
ipfw show | ./line_lite.sh '\*\*\*' green:underline | ./line_lite.sh "stat:" bright | ./pr -2 -t -l 86 -w 272 - > /tmp/foo
clear
cat /tmp/foo
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment