[fsync] check whether sensor exists and has been enabled when symlinking
This commit is contained in:
parent
5681ec612f
commit
7b5b64abf8
|
@ -238,10 +238,13 @@ end
|
||||||
|
|
||||||
-- generate new symlinks
|
-- generate new symlinks
|
||||||
for i = 1, MAX_SENSORS do
|
for i = 1, MAX_SENSORS do
|
||||||
local sensor_id = flukso[tostring(i)].id
|
if flukso[tostring(i)] ~= nil and flukso[tostring(i)].enable == '1' then
|
||||||
if sensor_id then
|
local sensor_id = flukso[tostring(i)].id
|
||||||
nixio.fs.symlink(CGI_SCRIPT, API_PATH .. sensor_id)
|
|
||||||
print(string.format('ln -s %s %s%s .. ok', CGI_SCRIPT, API_PATH, sensor_id))
|
if sensor_id then
|
||||||
|
nixio.fs.symlink(CGI_SCRIPT, API_PATH .. sensor_id)
|
||||||
|
print(string.format('ln -s %s %s%s .. ok', CGI_SCRIPT, API_PATH, sensor_id))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue