From e548ab67c894b51b3282a0bcebda5a5c1253037f Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Mon, 23 Dec 2024 22:15:16 +0100 Subject: [PATCH] Update 2024-12-23 22:15 OpenBSD/amd64-t14 --- .bin/network | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 .bin/network diff --git a/.bin/network b/.bin/network new file mode 100755 index 0000000..39b2268 --- /dev/null +++ b/.bin/network @@ -0,0 +1,25 @@ +#!/bin/sh + +for arg in "$@" +do + case "$arg" in + status) status=1 ;; + esac + shift +done + +_ifconfig() { + [ -z "$_ifdata" ] \ + && _ifdata="$(ifconfig)" + echo "$_ifdata" +} + +_interfaces="$(_ifconfig | egrep "^[a-z]" | cut -d: -f1 | egrep -v "lo0|enc0|pflog0" | xargs)" + +if [ -n "$status" ] +then + for _dev in $_interfaces + do + # something with awk + done +fi