Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
83
Issues
83
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
ccf29b0a
Commit
ccf29b0a
authored
Jul 16, 2012
by
Federico Vaga
Committed by
Alessandro Rubini
Jul 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flash-wrs: verify MAC before start flashing
Signed-off-by:
Federico Vaga
<
federico.vaga@gmail.com
>
parent
18175347
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
flash-wrs
build/flash-wrs
+22
-0
No files found.
build/flash-wrs
View file @
ccf29b0a
...
...
@@ -47,6 +47,15 @@ checkExit()
exit
1
}
checkMAC
()
{
X
=
"[0-9a-fA-F][0-9a-fA-F]"
if
echo
$1
|
grep
"^
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
:
${
X
}
\$
"
>
/dev/null
;
then
return
0
fi
return
1
}
modifyMAC
()
{
origin
=
$1
...
...
@@ -142,6 +151,19 @@ while [ $# -ge 1 ]; do
esac
done
#MAC address is a mandatory field
if
[
"x
$MAC
"
=
"x"
]
;
then
echo
"Error: MAC address is mandatory"
showhelp
exit
1
else
checkMAC
$MAC
if
[
$?
-eq
1
]
;
then
echo
"Error: MAC address is invalid (
$MAC
)"
exit
1
fi
fi
## Selecting the running memmode
if
[
"x
$memmode
"
=
"xdf"
]
;
then
df
=
1
...
...
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