summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormbornet-hl <mbornet.pro@wanadoo.fr>2015-03-22 13:20:00 +0100
committermbornet-hl <mbornet.pro@wanadoo.fr>2015-03-22 13:20:00 +0100
commitd1edd63b8718663559ec4063798d6e78ec8254c0 (patch)
treefb063b4e6f0b3a832f4c2b52db8ce9a747d3496f
parente9b9f8e25c5f974ae8c8ddb3c26ee99a0c6a621e (diff)
downloadhl-d1edd63b8718663559ec4063798d6e78ec8254c0.zip
hl-d1edd63b8718663559ec4063798d6e78ec8254c0.tar.gz
hl-d1edd63b8718663559ec4063798d6e78ec8254c0.tar.bz2
Added examples of scripts using the hl command.
-rwxr-xr-xhl_MAC9
-rwxr-xr-xhl_ethtool10
-rwxr-xr-xhl_ifconfig15
-rwxr-xr-xhl_iptables17
4 files changed, 51 insertions, 0 deletions
diff --git a/hl_MAC b/hl_MAC
new file mode 100755
index 0000000..2d35d10
--- /dev/null
+++ b/hl_MAC
@@ -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 .*'