Is it possible to reload the configuration without restart Kodi?
#1
Hi,

I'm working on a script that setups an SSH tunnel and changes the Kodi's proxy configuration. Both parts work well, but the proxy configuration is not working despite is setup properly in the guisettings.xml file.

I've seen in other thread (that I cannot find now) that it is not possible, but the post is from 2014 and I maybe things have changed.

So, is is possible to reload the configuration without restart Kodi?

Alternatively, is possible to make changes to the configuration from the terminal without modifying the XML files?

Thanks for making Kodi the software it is today!
Reply
#2
in short. no Wink

EDIT: not possible to re-load configuration if you edit guisettings.xml by hand but well.. it should be possible to change a setting via json-rpc. see http://kodi.wiki/view/JSON-RPC_API/v8#Se...ttingValue

example: https://forum.kodi.tv/showthread.php?tid=192491
Reply
#3
that is a pity...

Makes sense to make a feature request for this? Or is it so complicated that makes no sense to incorporate it?
Reply
#4
What is wrong with json-rpc?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
it would be nice if kill -HUP reloads the configuration, but that's not that easy to implement as you might think. json-rpc is your only choice for now (if it works. I can't test it but I believe it does work) so please have look at it.. it should do the job.
Reply
#6
Code:
curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"network.usehttpproxy","value":true},"id":1}' http://localhost:8080/jsonrpc

curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"network.httpproxytype","value":0},"id":1}' http://localhost:8080/jsonrpc

curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"network.httpproxyserver","value":"192.168.1.129"},"id":1}' http://localhost:8080/jsonrpc

curl -v -H "Content-type: application/json" -X POST -d '{"jsonrpc":"2.0","method":"Settings.SetSettingValue", "params":{"setting":"network.httpproxyport","value":8089},"id":1}' http://localhost:8080/jsonrpc

something like this ^^ should work for setting http proxy on 192.168.1.129:8089

good luck Wink
Reply
#7
Just to say, when Kodi is closed the current settings, as set in the gui, are saved to guisettings.xml. So any changes you make to guisettings.xml via an editor or script are over ridden.

So, yeah, what stefan said is the only way.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#8
(2017-07-12, 22:32)stefansaraev Wrote: it would be nice if kill -HUP reloads the configuration, but that's not that easy to implement as you might think. json-rpc is your only choice for now (if it works. I can't test it but I believe it does work) so please have look at it.. it should do the job.

Quitting Kodi from JSON-RPC definitely saves the guisettings. I have a python script that quits and restarts Kodi using a JSON-RPC call to quit Kodi, and I've confirmed that settings are saved. In fact, I moved to the JSON-RPC method specifically because killing the process caused me to lose settings.

If you're interested, the code is all on GitHub:

https://github.com/pkscout/restart.kodi

I've tested it on Windows and OS X, and with the right settings it seems to work fine. So it would probably work on the various Linux variants as well.
Reply
#9
Do you mean settings you have changed in the kodi gui, or from manually editing guisettings.xml?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#10
(2017-07-13, 05:56)nickr Wrote: Do you mean settings you have changed in the kodi gui, or from manually editing guisettings.xml?

Sorry I wasn't clear. Changed via the GUI. So you are, unsurprisingly right. Changes to guisettings.xml manually will get overwritten. I think you'd have to change them with JSON and the restart Kodi for them to stick.
Reply
#11
I believe add-on script.skin.helper.service can be used to set a guisetting via JSON-api. https://github.com/marcelveldt/script.sk...wiki/Tools

scott s.
.
Reply

Logout Mark Read Team Forum Stats Members Help
Is it possible to reload the configuration without restart Kodi?0