Thanks
How’s this?
[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”
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+mounted+successfully&priority=1”)
else log “failed to mount, Vera will try again in 10 mins”
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+unable+to+be+mounted&priority=1”)
luup.call_delay(“cifsmount”,600)
end
end
end[/code]
Can you remind me of the benefits of global to local, I seem to recall global means the call/function is always available.