diff options
author | mbornet-hl <mbornet.pro@wanadoo.fr> | 2015-03-22 13:20:00 +0100 |
---|---|---|
committer | mbornet-hl <mbornet.pro@wanadoo.fr> | 2015-03-22 13:20:00 +0100 |
commit | d1edd63b8718663559ec4063798d6e78ec8254c0 (patch) | |
tree | fb063b4e6f0b3a832f4c2b52db8ce9a747d3496f | |
parent | e9b9f8e25c5f974ae8c8ddb3c26ee99a0c6a621e (diff) | |
download | hl-d1edd63b8718663559ec4063798d6e78ec8254c0.zip hl-d1edd63b8718663559ec4063798d6e78ec8254c0.tar.gz hl-d1edd63b8718663559ec4063798d6e78ec8254c0.tar.bz2 |
Added examples of scripts using the hl command.
-rwxr-xr-x | hl_MAC | 9 | ||||
-rwxr-xr-x | hl_ethtool | 10 | ||||
-rwxr-xr-x | hl_ifconfig | 15 | ||||
-rwxr-xr-x | hl_iptables | 17 |
4 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,9 @@ +#!/bin/sh +# +# Colorize MAC addresses +# ~~~~~~~~~~~~~~~~~~~~~~ +# +# @(#) [MB] cr_hl_MAC Version 1.1 du 15/03/22 - +# + +hl -ei -c '([0-9a-f]{2}:){5}[0-9a-f]{2}' diff --git a/hl_ethtool b/hl_ethtool new file mode 100755 index 0000000..52e5329 --- /dev/null +++ b/hl_ethtool @@ -0,0 +1,10 @@ +#!/bin/bash +# +# Colorize ethtool output +# ~~~~~~~~~~~~~~~~~~~~~~~ +# +# @(#) [MB] cr_hl_ethtool Version 1.1 du 15/03/22 - +# + +hl -ei -r 'duplex:.*half|link detected:.*no|speed:.*100?Mb/s' \ + -g 'duplex:.*full|link detected:.*yes|speed:.*1000mb/s' diff --git a/hl_ifconfig b/hl_ifconfig new file mode 100755 index 0000000..cc97ddf --- /dev/null +++ b/hl_ifconfig @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Colorize ifconfig output +# ~~~~~~~~~~~~~~~~~~~~~~~~ +# +# %Z% [%Y%] %M% Version %I% du %E% - %Q% +# + +hl -ei -m '^(eth|(vir)?br|vnet)[0-9.]*:[0-9]+\>' \ + -b '^(eth|(vir)?br|vnet)[0-9.]*\.[0-9]+\>' \ + -c '([0-9a-f]{2}:){5}[0-9a-f]{2}' \ + -g '\<UP\>|\<RUNNING\>|([0-9]{1,3}\.){3}[0-9]{1,3}\>' \ + -y '^(eth|(vir)?br|vnet)[0-9.:]*\>' \ + -W '[0-9a-f]{4}::[0-9a-f]{4}\:[0-9a-f]{4}:[0-9a-f]{4}:[0-9a-f]{4}' \ + -r ' (errors|dropped|overruns):[^0][0-9]*' diff --git a/hl_iptables b/hl_iptables new file mode 100755 index 0000000..a05e6e3 --- /dev/null +++ b/hl_iptables @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Colorize iptables rules +# ~~~~~~~~~~~~~~~~~~~~~~~ +# +# @(#) [MB] cr_hl_iptables Version 1.1 du 15/03/22 - +# + + +hl -e -c 'INPUT' \ + -y 'FORWARD|POSTROUTING' \ + -b '#.*' \ + -W 'OUTPUT' \ + -g '.*ACCEPT.*' \ + -r '.*(DROP|REJECT).*' \ + -m 'iptables.*-F.*' \ + -w '^iptables .*' |