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.

ftp init-script and reboot from url
#1
Hi,

Is it possible to upload a init-script via ftp/sftp and reboot the LM5 from a url ?

We are using LM5 as site-controller on buildings with mqtts sub/pub to broker in AWS.
Ansible for automation tasks on servers, including fetching backups from LM's (http://<ip>/scada-main/general/backup)

Having a way to set IP parameters, init script and reboot would really help.

Any help is appreciated
Appreciat
-John
Appreciate any 
Reply
#2
You can use HTTP for this. See Apps documentation on how to create .lp server-side scripts: https://forum.logicmachine.net/showthread.php?tid=85
Code:
-- overwrite init script
io.writefile('/usr/share/lua/genohm-scada/initscript.lua', script)

-- set network config
require('uci')

uci.set('network', 'lan', 'ipaddr', '192.168.1.2')
uci.set('network', 'lan', 'netmask', '255.255.255.0')
uci.set('network', 'lan', 'gateway', '192.168.1.1')
uci.set('network', 'lan', 'dns', '8.8.8.8')

uci.commit('network')

-- reboot
os.execute('reboot')
Reply
#3
(18.08.2022, 06:59)admin Wrote: You can use HTTP for this. See Apps documentation on how to create .lp server-side scripts: https://forum.logicmachine.net/showthread.php?tid=85
Code:
-- overwrite init script
io.writefile('/usr/share/lua/genohm-scada/initscript.lua', script)

-- set network config
require('uci')

uci.set('network', 'lan', 'ipaddr', '192.168.1.2')
uci.set('network', 'lan', 'netmask', '255.255.255.0')
uci.set('network', 'lan', 'gateway', '192.168.1.1')
uci.set('network', 'lan', 'dns', '8.8.8.8')

uci.commit('network')

-- reboot
os.execute('reboot')

Thanks admin!
Reply


Forum Jump: