Skip to content

Commit

Permalink
system: if no temperature sysctls are exposed do nothing
Browse files Browse the repository at this point in the history
Likely cause for syntax error in user report.

PR: https://forum.opnsense.org/index.php?topic=28684.0
  • Loading branch information
fichtner committed Jun 10, 2022
1 parent 552f86f commit 3a5484d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/opnsense/scripts/system/temperature.sh
Expand Up @@ -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

0 comments on commit 3a5484d

Please sign in to comment.