From 6f2121819393f446ae73cd4a15ca02a8d10595d0 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 3 Sep 2024 14:48:07 +0200 Subject: [PATCH] system: remove RRD temp read from temperature.sh --- src/opnsense/scripts/system/temperature.sh | 30 ++++--------------- .../conf/actions.d/actions_system.conf | 2 +- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/opnsense/scripts/system/temperature.sh b/src/opnsense/scripts/system/temperature.sh index bc9e43a0b..66b4ce005 100755 --- a/src/opnsense/scripts/system/temperature.sh +++ b/src/opnsense/scripts/system/temperature.sh @@ -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 diff --git a/src/opnsense/service/conf/actions.d/actions_system.conf b/src/opnsense/service/conf/actions.d/actions_system.conf index 2543a4ba3..4b12d51f2 100644 --- a/src/opnsense/service/conf/actions.d/actions_system.conf +++ b/src/opnsense/service/conf/actions.d/actions_system.conf @@ -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