Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
3638145a
Commit
3638145a
authored
Mar 22, 2012
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-interfaces: be more verbose on what ports are already added to bridge
parent
80387939
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
setup-interfaces.in
setup-interfaces.in
+21
-9
No files found.
setup-interfaces.in
View file @
3638145a
...
...
@@ -88,7 +88,7 @@ To add this interface to a bridge enter the bridge name (eg 'br0' or 'bridge0')
__EOF__
}
bridge_add_
iface
()
{
bridge_add_
port
()
{
local
bridge
=
$1
iface
=
shift
for
iface
;
do
...
...
@@ -98,6 +98,12 @@ bridge_add_iface() {
done
}
bridge_list_ports
()
{
if
[
-r
$1
.bridge_ports
]
;
then
echo
$(
cat
$1
.bridge_ports
)
fi
}
config_iface
()
{
local
iface
=
$1
local
prefix
=
$2
...
...
@@ -117,7 +123,7 @@ config_iface() {
if
[
"
$resp
"
=
"yes"
]
;
then
bridge
=
"br"
`
echo
$iface
|
sed
's/[^0-9]//g'
`
ask
"Name of the bridge you want add
$iface
to:"
$bridge
bridge_add_
iface
$resp
$iface
bridge_add_
port
$resp
$iface
return
fi
...
...
@@ -146,7 +152,7 @@ config_iface() {
# we dont allow bridge bridges
br[0-9]
*
|
bridge[0-9]
*
)
continue
;;
esac
bridge_add_
iface
$resp
$iface
bridge_add_
port
$resp
$iface
return
;;
esac
done
...
...
@@ -216,21 +222,27 @@ unconfigured_all_are() {
}
config_bridge
()
{
local
bridge
=
$1
iflist
=
local
bridge
=
$1
iflist
=
i
=
ports
=
while
!
unconfigured_all_done
;
do
set
--
$(
unconfigured_non_bridges
)
[
$#
-eq
0
]
&&
return
0
;
ports
=
$(
bridge_list_ports
$bridge
)
if
[
-n
"
$ports
"
]
;
then
echo
"Bridge ports in
$bridge
are:
$ports
"
fi
echo
"Available bridge ports are:
$@
"
ask
"Which port(s) do you want add to bridge
$bridge
? (or 'done')"
$1
case
$resp
in
'abort'
)
return
1
;;
'done'
)
return
0
;;
esac
if
unconfigured_all_are
$resp
;
then
bridge_add_iface
$bridge
$resp
continue
fi
echo
"
$resp
is not a valid interface"
for
i
in
$resp
;
do
if
unconfigured_isin
$i
;
then
bridge_add_port
$bridge
$i
else
echo
"
$i
is not valid"
fi
done
done
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment