system: remove RRD temp read from temperature.sh

This commit is contained in:
Franco Fichtner 2024-09-03 14:48:07 +02:00
parent 9a71a3919e
commit 6f21218193
2 changed files with 7 additions and 25 deletions

View File

@ -24,28 +24,10 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
CMD=${1}
SYSCTLS="
dev.cpu.0.temperature
hw.acpi.thermal.tz0.temperature
hw.temperature.CPU
"
if [ "${CMD}" = 'rrd' ]; then
for SYSCTL in ${SYSCTLS}; do
TEMP=$(sysctl -i -n ${SYSCTL} | sed 's/C//g')
if [ -n "${TEMP}" ]; then
echo ${TEMP}
break
fi
done
else
# The grep is opportunistic, but at least we only grep the
# 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
# The grep is opportunistic, but at least we only grep the
# 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

View File

@ -85,7 +85,7 @@ message:Halt system
[temp]
command:/usr/local/opnsense/scripts/system/temperature.sh
parameters:%s
parameters:
type:script_output
message:Reading system temperature values