system: if no temperature sysctls are exposed do nothing

Likely cause for syntax error in user report.

PR: https://forum.opnsense.org/index.php?topic=28684.0
This commit is contained in:
Franco Fichtner 2022-06-10 13:50:01 +02:00
parent 552f86f9ea
commit 3a5484dcd5

View File

@ -42,6 +42,10 @@ if [ "${CMD}" = 'rrd' ]; then
done
else
# The grep is opportunistic, but at least we only grep the
# variable names and not their content at the same time.
sysctl -e $(sysctl -aN | grep temperature) | sort
# variable names and not their content at the same time and
# as long as we can find something that matches our search.
SYSCTLS=$(sysctl -aN | grep temperature)
if [ -n "${SYSCTLS}" ]; then
sysctl -e ${SYSCTLS} | sort
fi
fi