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.

Remote script modification
#2
You can create a custom .lp file that will handle this, to which you must pass name and script get/post variables. Like this: http://LM_IP/user/update.lp?name=test&script=log(event)
For better security you should add some extra password/variable check to this file.

Code:
<?

name = getvar('name')
scriptdata = getvar('script')

if name and scriptdata then
  item = script.get(name)
  
  if item then
    item.script = scriptdata

    db:update('scripting', { script = scriptdata }, { id = item.id })

    -- save script data to file
    script.save(item, true)
    -- reload script/group monitor
    script.reloadsingle(item)

    print('update ok')
  else
    print('script not found')
  end
else
  print('invalid arguments')
end
Reply


Messages In This Thread
Remote script modification - by Hippolyte - 12.02.2018, 08:15
RE: Remote script modification - by admin - 13.02.2018, 11:33
RE: Remote script modification - by Hippolyte - 13.02.2018, 11:55
RE: Remote script modification - by Hippolyte - 20.03.2018, 13:39
RE: Remote script modification - by admin - 20.03.2018, 14:30
RE: Remote script modification - by Hippolyte - 20.03.2018, 16:27
RE: Remote script modification - by admin - 20.03.2018, 17:26
RE: Remote script modification - by Hippolyte - 21.03.2018, 11:11
RE: Remote script modification - by buuuudzik - 21.03.2018, 12:08
RE: Remote script modification - by admin - 21.03.2018, 12:41
RE: Remote script modification - by Hippolyte - 21.03.2018, 16:38
RE: Remote script modification - by admin - 21.03.2018, 17:14
RE: Remote script modification - by Hippolyte - 22.03.2018, 09:40
RE: Remote script modification - by buuuudzik - 22.03.2018, 10:19
RE: Remote script modification - by admin - 22.03.2018, 10:45
RE: Remote script modification - by Hippolyte - 23.03.2018, 14:28
RE: Remote script modification - by Hippolyte - 30.03.2018, 14:58
RE: Remote script modification - by admin - 30.03.2018, 15:20
RE: Remote script modification - by Leo681 - 26.02.2023, 21:13
RE: Remote script modification - by admin - 27.02.2023, 06:59

Forum Jump: