mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
get the correct name from the routerboard and replace all special characters with _
This commit is contained in:
parent
3dd16cc568
commit
74b7eb2a46
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ printf '( exit %q )' "$ret" >&2;
|
|||
function get_name {
|
||||
while read -r line; do
|
||||
if echo "$line" | grep -q 'name:'; then
|
||||
name=$(echo "$line" | grep name: | awk '{ print $2 }')
|
||||
name="$(echo "$line" | grep -E '\s+name:' | cut -f2 -d: | sed 's/^ *//g' | sed 's/[^A-Za-z0-9]/_/')"
|
||||
fi
|
||||
done <<< "$data"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue