1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Strip all non-ASCII characters from hddtemp output (#136)

This commit is contained in:
einarjh
2017-06-10 11:20:48 +02:00
committed by Neil Lathwood
parent 3903f431f7
commit cc6d7882db

View File

@@ -32,7 +32,7 @@ if [ "${hddtemp}" != "" ]; then
else
output=`${hddtemp} -w -q ${disks} 2>/dev/null`
fi
content=`echo "$output" | awk -F": " 'BEGIN{ ORS="" }{ print "|"$1"|"$2"|"$3"|";} ' | sed 's/[° ]C|/|C|/g' | sed 's/[° ]F|/|F|/g'`
content=`echo "$output" | awk -F": " 'BEGIN{ ORS="" }{ print "|"$1"|"$2"|"$3"|";} ' | sed 's/[° ]C|/|C|/g' | sed 's/[° ]F|/|F|/g' | tr -cd '\12\14\40-\176'`
if [ "${content}" != "" ]; then
echo '<<<hddtemp>>>'
echo ${content}