summaryrefslogtreecommitdiff
path: root/files/common/openwrt/sensors-init.lua
blob: a283bfc76bcde8bacfd8d2f53efd69d7451e88a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/lua

local sensors = require "sensors"

local config, err = sensors.read_config('/etc/sensors.json')
if not config then error(err) end

local num_sensors, err = sensors.setup(config)
if not num_sensors then error(err) end
print(string.format("successfully initialized %d sensor(s)", num_sensors))