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
012623f7
Commit
012623f7
authored
Mar 22, 2012
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-interfaces: have the xen bridge stuff to use the new ifup bridge thingy
parent
5ba66334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
31 deletions
+19
-31
setup-interfaces.in
setup-interfaces.in
+19
-31
No files found.
setup-interfaces.in
View file @
012623f7
...
...
@@ -7,8 +7,6 @@ for i in ./libalpine.sh $PREFIX/lib/libalpine.sh; do
[
-e
$i
]
&&
.
$i
&&
break
done
bridges
=
""
unconfigured_add
()
{
touch
$1
.noconf
}
...
...
@@ -90,6 +88,16 @@ To add this interface to a bridge enter the bridge name (eg 'br0' or 'bridge0')
__EOF__
}
bridge_add_iface
()
{
local
bridge
=
$1
iface
=
shift
for
iface
;
do
echo
$iface
>>
$bridge
.bridge_ports
unconfigured_add
$bridge
unconfigured_del
$iface
done
}
config_iface
()
{
local
iface
=
$1
local
prefix
=
$2
...
...
@@ -100,23 +108,17 @@ config_iface() {
while
[
-n
"
$ask_bridge
"
]
;
do
ask
"Do you want to bridge the interface
$iface
?"
no
answer
=
$resp
case
"
$answer
"
in
yes
|
y
)
answer
=
yes
;
break
;;
case
"
$resp
"
in
yes
|
y
)
resp
=
yes
;
break
;;
no|n
)
break
;;
esac
done
if
[
"
$
answer
"
=
"yes"
]
;
then
if
[
"
$
resp
"
=
"yes"
]
;
then
bridge
=
"br"
`
echo
$iface
|
sed
's/[^0-9]//g'
`
while
[
1
]
;
do
ask
"Name of the bridge you would like to create:"
$bridge
bridge
=
$resp
`
echo
"
$bridges
"
|
grep
-q
"
$bridge
"
`
||
break
echo
"Name already in use, please choose another one"
done
echo
"bridge=
${
bridge
}
"
>
$conf
bridges
=
"
$bridges
$bridge
"
ask
"Name of the bridge you want add
$iface
to:"
$bridge
bridge_add_iface
$resp
$iface
return
fi
if
[
-r
"
$iface
.bridge_ports"
]
;
then
...
...
@@ -144,9 +146,7 @@ config_iface() {
# we dont allow bridge bridges
br[0-9]
*
|
bridge[0-9]
*
)
continue
;;
esac
echo
"
$iface
"
>>
$resp
.bridge_ports
unconfigured_add
$resp
unconfigured_del
$iface
bridge_add_iface
$resp
$iface
return
;;
esac
done
...
...
@@ -239,20 +239,8 @@ prompt_for_interfaces() {
type
=
gateway
=
.
./
$i
if
[
-n
"
$bridge
"
]
;
then
echo
"auto
$iface
$bridge
"
>>
interfaces
echo
""
>>
interfaces
echo
"iface
$iface
inet manual"
>>
interfaces
echo
-e
"
\t
up ip link set
\$
IFACE up"
>>
interfaces
echo
-e
"
\t
down ip link set
\$
IFACE down"
>>
interfaces
echo
""
>>
interfaces
echo
"iface
$bridge
inet
$type
"
>>
interfaces
echo
-e
"
\t
pre-up brctl addbr
$bridge
"
>>
interfaces
echo
-e
"
\t
pre-up brctl addif
$bridge
$iface
"
>>
interfaces
else
echo
"auto
$iface
"
>>
interfaces
echo
"iface
$iface
inet
$type
"
>>
interfaces
fi
echo
"auto
$iface
"
>>
interfaces
echo
"iface
$iface
inet
$type
"
>>
interfaces
if
[
-n
"
$bridge_ports
"
]
;
then
echo
-e
"
\t
bridge-ports
$bridge_ports
"
>>
interfaces
fi
...
...
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