[fsync] check whether sensor exists and has been enabled when symlinking
This commit is contained in:
parent
5681ec612f
commit
7b5b64abf8
|
@ -238,11 +238,14 @@ end
|
|||
|
||||
-- generate new symlinks
|
||||
for i = 1, MAX_SENSORS do
|
||||
if flukso[tostring(i)] ~= nil and flukso[tostring(i)].enable == '1' then
|
||||
local sensor_id = flukso[tostring(i)].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
|
||||
|
||||
print(arg[0] .. ' completed successfully. Bye!')
|
||||
|
|
Loading…
Reference in New Issue