Projet

Général

Profil

Révision 3e83f451

ID3e83f451d0ca9648501b2eb30cbe823d0501e6b0
Parent f7282a83
Enfant 00cbc8d3

Ajouté par Younes Ichiche il y a presque 4 ans

fix get_ros_version function

Voir les différences:

plugins/router/mikrotik_system
77 77
}
78 78
function get_ros_version {
79 79
  while read -r line; do
80
    if echo "$line" | grep -q 'version:'; then
81
      if echo "$line" | cut -f2 -d" " | grep --quiet "^7\."; then
82
        ros_version="7"
83
      else
80
    if echo "$line" | grep -q 'version: '; then
81
      if echo "$line" | awk '/version:/{print $2}' | grep -q  "^[0-6]\."; then
84 82
        ros_version="6"
83
      else
84
        ros_version="7"
85 85
      fi
86 86
    fi
87 87
  done <<< "$data"

Formats disponibles : Unified diff