Developing lightweight computation at the DSG edge

Commit ee1356cf authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

Fix qmp_get_primary_device, gets only the name of first device, when eth0 doesn't exists.

parent 9f091134
......@@ -47,7 +47,7 @@ qmp_get_primary_device() {
if ip link show dev eth0 > /dev/null; then
primary_mesh_device="eth0"
else
primary_mesh_device="$(ip link show | egrep ^[0-9]?: | grep -v lo: | awk NR==1)"
primary_mesh_device="$(ip link show | egrep ^[0-9]?: | grep -v lo: | awk 'NR==1{sub(/:$/,"",$2); print $2}')"
fi
[ -z "$primary_mesh_device" ] && echo "CRITICAL: No primary network device found, please define qmp.node.primary_device"
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment