mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 09:36:41 -04:00
Fixes "[ERROR] config error" that occurs if "." (dot) is in label PR: 281118 Reported by: takefu <takefu@airport.fm> Tested by: John W. O'Brien <john@saltant.com> Approved by: portmgr (maintainer timeout, 3+ months)
25 lines
453 B
Bash
25 lines
453 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
set -u
|
|
|
|
cat <<'EOM'
|
|
graph_title ZFS dataset compression ratio
|
|
graph_vlabel ratio
|
|
graph_category ZFS
|
|
graph_info This graph shows the ZFS dataset compression ratio
|
|
EOM
|
|
|
|
listing=$(zfs get -t filesystem -H compressratio)
|
|
|
|
while read -r label _ ratio _; do
|
|
clean_label=$(echo "${label}" | sed -e 's|/|__|g' -e 's|\.|_|g' )
|
|
echo "${clean_label}.label ${label}"
|
|
echo "${clean_label}.value ${ratio%x}"
|
|
done <<eot
|
|
${listing}
|
|
eot
|
|
|
|
exit 0
|
|
|
|
|