Révision 74b7eb2a
get the correct name from the routerboard and replace all special characters with _
| 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