Commit 3b0d13c9 authored by geb's avatar geb

Add defensive quoting and error catch around udevadm info just in case (refs: #17784)

parent e9b86c7e
......@@ -43,9 +43,9 @@ get_module_used_by_nic() {
}
get_name_of_nic() {
vendor=$(udevadm info -x --query=property /sys/class/net/${1} | sed -n "s/ID_VENDOR_FROM_DATABASE='\(.*\)'/\\1/p")
device=$(udevadm info -x --query=property /sys/class/net/${1} | sed -n "s/ID_MODEL_FROM_DATABASE='\(.*\)'/\\1/p")
echo "$vendor $device"
vendor=$(udevadm info -x --query=property /sys/class/net/${1} | sed -n "s/ID_VENDOR_FROM_DATABASE='\(.*\)'/\\1/p" || : )
device=$(udevadm info -x --query=property /sys/class/net/${1} | sed -n "s/ID_MODEL_FROM_DATABASE='\(.*\)'/\\1/p" || : )
echo "${vendor} ${device}"
}
# Auxillary function for mod_rev_dep(). It recurses over the graph of
......
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