Skip to content

Commit

Permalink
Find bridge interfaces by interface group (#282)
Browse files Browse the repository at this point in the history
This allows users to give their bridges custom names.
We might make use of this as well in the future
(think $POT_BRIDGE_NAME).
  • Loading branch information
grembo committed Dec 20, 2023
1 parent 810af78 commit 7b8c376
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- start: Fix setting of nullfs attribute
- set-status: Ignore status files that predate system boot (#278)
- set-status: Forward verbosity flags (#279)
- network: Find bridge interfaces by interface group, this allows custom bridge names (#282)

## [0.15.6] 2023-09-29
### Added
Expand Down
6 changes: 3 additions & 3 deletions share/pot/network.sh
Expand Up @@ -10,7 +10,7 @@ _pot_bridge()
_pot_bridge_ipv4()
{
local _bridges
_bridges=$( ifconfig | grep ^bridge | cut -f1 -d':' )
_bridges=$( ifconfig -g bridge )
if [ -z "$_bridges" ]; then
return
fi
Expand All @@ -26,7 +26,7 @@ _pot_bridge_ipv4()
_pot_bridge_ipv6()
{
local _bridges
_bridges=$( ifconfig | grep ^bridge | cut -f1 -d':' )
_bridges=$( ifconfig -g bridge )
if [ -z "$_bridges" ]; then
return
fi
Expand All @@ -43,7 +43,7 @@ _private_bridge()
{
local _bridges _bridge _bridge_ip
_bridge="$1"
_bridges=$( ifconfig | grep ^bridge | cut -f1 -d':' )
_bridges=$( ifconfig -g bridge )
if [ -z "$_bridges" ]; then
return
fi
Expand Down
7 changes: 7 additions & 0 deletions tests/network1.sh
Expand Up @@ -59,6 +59,13 @@ bridge2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
EOF--
return 0 # true
elif [ "$1" = "-g" ] && [ "$2" = "bridge" ]; then
cat << EOF--
bridge0
bridge1
bridge2
EOF--
return 0 # true
elif [ "$1" = "bridge0" ]; then
Expand Down

0 comments on commit 7b8c376

Please sign in to comment.