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