From 6a240c970cb81a23aead32c462d93de461dce263 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Mon, 23 Dec 2024 22:17:58 +0100 Subject: [PATCH] Update 2024-12-23 22:17 OpenBSD/amd64-t14 --- .bin/network | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.bin/network b/.bin/network index 39b2268..e384ea6 100755 --- a/.bin/network +++ b/.bin/network @@ -1,22 +1,35 @@ #!/bin/sh +### DEFAULTS + + +### ARGUMENTS for arg in "$@" do case "$arg" in - status) status=1 ;; + start) _start=1 ;; + stop) _stop=1 ;; + status) _status=1 ;; + route) _route=1 ;; + wifi) _wifi=1 ;; + hotspot) _hotspot=1 ;; + adhoc) _adhoc=1 ;; esac shift done +### FUNCTIONS _ifconfig() { [ -z "$_ifdata" ] \ && _ifdata="$(ifconfig)" echo "$_ifdata" } +### DATA _interfaces="$(_ifconfig | egrep "^[a-z]" | cut -d: -f1 | egrep -v "lo0|enc0|pflog0" | xargs)" -if [ -n "$status" ] +### MAIN PROGRAM +if [ -n "$_status" ] then for _dev in $_interfaces do