Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
2141e10b
Commit
2141e10b
authored
18 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Configuring EoE bridge at startup.
parent
55f64546
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
script/ethercat.sh
+46
-2
46 additions, 2 deletions
script/ethercat.sh
script/sysconfig
+30
-0
30 additions, 0 deletions
script/sysconfig
with
76 additions
and
2 deletions
script/ethercat.sh
+
46
−
2
View file @
2141e10b
...
...
@@ -66,14 +66,14 @@ case "$1" in
start
)
echo
-n
"Starting EtherCAT master "
if
[
!
$DEVICE_INDEX
]
;
then
if
[
-z
"
$DEVICE_INDEX
"
]
;
then
echo
"ERROR: DEVICE_INDEX not set!"
/bin/false
rc_status
-v
rc_exit
fi
if
[
!
$EOE_DEVICES
]
;
then
if
[
-z
"
$EOE_DEVICES
"
]
;
then
EOE_DEVICES
=
0
fi
...
...
@@ -99,6 +99,50 @@ case "$1" in
rc_exit
fi
# Build EoE bridge
if
[
-n
"
$EOE_BRIDGE
"
]
;
then
EOE_INTERFACES
=
`
/sbin/ifconfig
-a
|
grep
-o
-E
"^eoe[0-9]+ "
`
# add bridge, if it does not already exist
if
!
/sbin/brctl show |
grep
-E
-q
"^
$EOE_BRIDGE
"
;
then
if
!
/sbin/brctl addbr
$EOE_BRIDGE
;
then
/bin/false
rc_status
-v
rc_exit
fi
fi
# free all interfaces of their addresses and add them to the bridge
for
interface
in
$EOE_INTERFACES
$EOE_EXTRA_INTERFACES
;
do
if
!
/sbin/ifconfig
$interface
0.0.0.0 up
;
then
/bin/false
rc_status
-v
rc_exit
fi
if
!
/sbin/brctl show |
grep
-E
-q
"^
$EOE_BRIDGE
.*
$interface
"
;
then
if
!
/sbin/brctl addif
$EOE_BRIDGE
$interface
;
then
/bin/false
rc_status
-v
rc_exit
fi
fi
done
if
[
-n
"
$EOE_IP_ADDRESS
"
-a
-n
"
$EOE_IP_NETMASK
"
]
;
then
if
!
/sbin/ifconfig
$EOE_BRIDGE
$EOE_IP_ADDRESS
\
netmask
$EOE_IP_NETMASK
;
then
/bin/false
rc_status
-v
rc_exit
fi
fi
if
!
/sbin/ifconfig
$EOE_BRIDGE
up
;
then
/bin/false
rc_status
-v
rc_exit
fi
fi
rc_status
-v
;;
...
...
This diff is collapsed.
Click to expand it.
script/sysconfig
+
30
−
0
View file @
2141e10b
...
...
@@ -18,4 +18,34 @@
#
#EOE_DEVICES=0
#
# Bridge all EoE interfaces after master startup
# This variable shall contain the name of the EoE bridge to set up.
# If the variable is empty or undefined, no EoE bridge will be built.
#
#EOE_BRIDGE=eoebr0
#
# IP address of the EoE bridge
# Set both EOE_IP_ADDRESS and EOE_IP_NETMASK to let the local host communicate
# with devices on the EoE bridge.
#
#EOE_IP_ADDRESS=192.168.X.X
#
# IP netmask of the EoE bridge
# See EOE_IP_ADDRESS.
#
#EOE_IP_NETMASK=255.255.255.0
#
# List of extra interfaces to include in the EoE bridge.
# Set this to interconnect the EoE bridge with other local interfaces.
# If EOE_BRIDGE is empty or undefined, setting this variable has no effect.
# Important: The IP address of these interfaces will be cleared. Set
# EOE_IP_ADDRESS and EOE_IP_NETMASK accordingly to enable IP traffic to
# extra interfaces.
#
#EOE_EXTRA_INTERFACES=eth0
#------------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment