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
|
#!/bin/sh
|
||||||
|
|
||||||
|
### DEFAULTS
|
||||||
|
|
||||||
|
|
||||||
|
### ARGUMENTS
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
do
|
do
|
||||||
case "$arg" in
|
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
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
### FUNCTIONS
|
||||||
_ifconfig() {
|
_ifconfig() {
|
||||||
[ -z "$_ifdata" ] \
|
[ -z "$_ifdata" ] \
|
||||||
&& _ifdata="$(ifconfig)"
|
&& _ifdata="$(ifconfig)"
|
||||||
echo "$_ifdata"
|
echo "$_ifdata"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
### DATA
|
||||||
_interfaces="$(_ifconfig | egrep "^[a-z]" | cut -d: -f1 | egrep -v "lo0|enc0|pflog0" | xargs)"
|
_interfaces="$(_ifconfig | egrep "^[a-z]" | cut -d: -f1 | egrep -v "lo0|enc0|pflog0" | xargs)"
|
||||||
|
|
||||||
if [ -n "$status" ]
|
### MAIN PROGRAM
|
||||||
|
if [ -n "$_status" ]
|
||||||
then
|
then
|
||||||
for _dev in $_interfaces
|
for _dev in $_interfaces
|
||||||
do
|
do
|
||||||
|
Loading…
Reference in New Issue
Block a user