mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
system: protect -n test with quotes, shell style while at it
This commit is contained in:
parent
e0f9acc76a
commit
248664c816
@ -26,12 +26,17 @@
|
||||
|
||||
CMD=${1}
|
||||
|
||||
SYSCTLS="
|
||||
dev.cpu.0.temperature
|
||||
hw.acpi.thermal.tz0.temperature
|
||||
hw.temperature.CPU
|
||||
"
|
||||
|
||||
if [ "${CMD}" = 'rrd' ]; then
|
||||
for i in dev.cpu.0.temperature hw.acpi.thermal.tz0.temperature hw.temperature.CPU
|
||||
do
|
||||
temp=`sysctl -i -n $i | sed 's/C//g'`
|
||||
if [ ! -z $temp ]; then
|
||||
echo $temp
|
||||
for SYSCTL in ${SYSCTLS}; do
|
||||
TEMP=$(sysctl -i -n ${SYSCTL} | sed 's/C//g')
|
||||
if [ -n "${TEMP}" ]; then
|
||||
echo ${TEMP}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user