This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Execute the script from remote .lua file
#1
Hello,

do you know if there is a possibility to download the .lua file from remote localization and execute it on LM? Such possibility could be helpful for service purpose.
Reply
#2
You can load source via HTTP request, then execute it like this (data variable must contain valid Lua code):
Code:
fn = loadstring(data)
fn()
Reply
#3
Very powerfull toolWink
Reply
#4
This is wonderfull! Now I can load a lua table from object comment.
LM5Lp, firmware: 2018.08.22 and 2021.12.15, FlashSYS v2, ARMv7 Processor rev 5 (v7l), kernel 4.4.151 and 4.4.259
Reply
#5
How to load? Can you help me? detail.

Thank you so much
Big Grin
Thanks & Best Regards
Reply
#6
(15.08.2017, 09:33)nhieulk Wrote: How to load? Can you help me? detail.

Thank you so much
Big Grin

E.g. like below:
Code:
data = socket.http.request('http://scripts.com/script1.lua')
fn = loadstring(data)

fn()
Reply


Forum Jump: