1
0
Fork 0
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:
Younes Ichiche 2021-12-06 11:21:55 +01:00 committed by Lars Kruse
parent f7282a83d4
commit 3e83f451d0

View file

@ -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"