Projet

Général

Profil

Révision 74b7eb2a

ID74b7eb2a46f00980a7990477a85c8bee960b578b
Parent 3dd16cc5
Enfant 38649d31

Ajouté par Younes Ichiche il y a presque 4 ans

get the correct name from the routerboard and replace all special characters with _

Voir les différences:

plugins/router/mikrotik_system
67 67
function get_name {
68 68
  while read -r line; do
69 69
    if echo "$line" | grep -q 'name:'; then
70
      name=$(echo "$line" | grep name: | awk '{ print $2 }')
70
      name="$(echo "$line" | grep -E '\s+name:' | cut -f2 -d: | sed 's/^ *//g' | sed 's/[^A-Za-z0-9]/_/')"
71 71
    fi
72 72
  done <<< "$data"
73 73
}

Formats disponibles : Unified diff