summaryrefslogtreecommitdiff
path: root/files/common/openwrt/sensors-init.lua
blob: 5e2cd0ee6496a1cdfc18352e22b010eed9f38bfa (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 num_sensors == nil then error(err) end
print(string.format("successfully initialized %d sensor(s)", num_sensors))