mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
fix get_ros_version function
This commit is contained in:
parent
f7282a83d4
commit
3e83f451d0
1 changed files with 4 additions and 4 deletions
|
@ -77,11 +77,11 @@ function get_name {
|
|||
}
|
||||
function get_ros_version {
|
||||
while read -r line; do
|
||||
if echo "$line" | grep -q 'version:'; then
|
||||
if echo "$line" | cut -f2 -d" " | grep --quiet "^7\."; then
|
||||
ros_version="7"
|
||||
else
|
||||
if echo "$line" | grep -q 'version: '; then
|
||||
if echo "$line" | awk '/version:/{print $2}' | grep -q "^[0-6]\."; then
|
||||
ros_version="6"
|
||||
else
|
||||
ros_version="7"
|
||||
fi
|
||||
fi
|
||||
done <<< "$data"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue