Update 2024-12-23 22:17 OpenBSD/amd64-t14
This commit is contained in:
parent
e548ab67c8
commit
6a240c970c
17
.bin/network
17
.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
|
||||
|
Loading…
Reference in New Issue
Block a user