Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Quick Mesh Project
qMp packages
Commits
58c35c64
Commit
58c35c64
authored
Apr 23, 2013
by
Simó Albert i Beltran
Browse files
Improve qmp_get_dev_from_mac function.
parent
aaba5ee6
Changes
1
Hide whitespace changes
Inline
Side-by-side
packages/qmp-system/files/etc/qmp/qmp_common.sh
View file @
58c35c64
...
...
@@ -194,7 +194,7 @@ qmp_get_dev_from_mac() {
# Returns the mac address of the device
# qmp_get_mac_for_dev eth0
qmp_get_mac_for_dev
()
{
mac
=
"
$(
ip
link
show dev
$1
|
grep
-m
1
"link/ether"
|
awk
'{print $2}'
)
"
mac
=
"
$(
cat
/sys/class/net/
$1
/address
)
"
[
-z
"
$mac
"
]
&&
mac
=
"00:00:00:00:00:00"
echo
"
$mac
"
}
...
...
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