Hi @akbooer
Just looking at your code for mounting an external CIFS share and I was wondering what to add to have it check for the mount e.g every 30mins and then if the mount (or target share is not there) it should try to mount it again.
(Example of how this may be of use… The NAS is off when the Vera restarts/reloads.
[code]-- cifs mount for use during startup
– @akbooer 2014-04-23
local function df ()
local info
local p = io.popen (“df”,‘r’)
if p then info = p:read “*a”; p:close () end
return info
end
local function cifsmount (x)
local function log (msg) luup.log ((“‘%s’ %s”): format (x.device or ‘’, msg), ‘mount’) end
local df = df ()
if df: find (x.device, 1, true) then
log “already mounted”
else
local cmd = table.concat {“mount -t cifs -o user=”, x.user, “,pass=”, x.pass, ",nounix,noserverino " , x.device, ’ ', x.directory}
local ok = os.execute (cmd)
if ok
then log “mounted OK”
else log “failed to mount”
end
end
end
cifsmount {user=user, pass=pass, device=device, directory=directory}[/code]
Also if I wanted to add a prowl notification to this to confirm it is mounted, where is the best place to put it?
luup.inet.wget("http://www.prowlapp.com/publicapi/add?apikey=Myapikey&application=Vera+StartUp+Notification&event=Alert&description=Vera+has+restarted.+The+external+NAS+share+was+" .. Status .. "+mapped&priority=1")
…Status… would be either ‘successfully’ or ‘unsuccessfully’.