1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51: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

@ -78,10 +78,10 @@ function get_name {
function get_ros_version { function get_ros_version {
while read -r line; do while read -r line; do
if echo "$line" | grep -q 'version: '; then if echo "$line" | grep -q 'version: '; then
if echo "$line" | cut -f2 -d" " | grep --quiet "^7\."; then if echo "$line" | awk '/version:/{print $2}' | grep -q "^[0-6]\."; then
ros_version="7"
else
ros_version="6" ros_version="6"
else
ros_version="7"
fi fi
fi fi
done <<< "$data" done <<< "$data"